Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
cordic.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  cordic_iq
 

Functions

struct cordic_iq cordic_calc_iq (s32 theta)
 

Function Documentation

struct cordic_iq cordic_calc_iq ( s32  theta)
read

cordic_calc_iq() - calculates the i/q coordinate for given angle.

: angle in degrees for which i/q coordinate is to be calculated. : function output parameter holding the i/q coordinate.

The function calculates the i/q coordinate for a given angle using the CORDIC algorithm. The coordinate consists of a real (i) and an imaginary (q) part. The real part is essentially the cosine of the angle and the imaginary part is the sine of the angle. The returned values are scaled by 2^16 for precision. The range for theta is for -180 degrees to +180 degrees. Passed values outside this range are converted before doing the actual calculation.

Definition at line 55 of file cordic.c.