59 return (deg * M_PI / 180.0);
84 quads = modf(quads, &intpart);
149 double degree, rad, orig;
191 rad = angle * M_PI / 2.0;
197 printf(
"Degree:%lf, rad:%lf, quad:%d\n",
198 (
double)angle, (
double) rad, (
int)quad);
199 printf(
"ccos:%lf, cos:%lf, error:%lf\n",
201 printf(
"csin:%lf, sin:%lf, error:%lf\n",
267 double sinx, siny, sinz, cosx, cosy, cosz;
268 double x,
y,z,x1,y1,z1;
282 x1 = x*cosz + y*sinz;
283 y1 = -x*sinz + y*cosz;
287 y = y1*cosx + z1*sinx;
288 z = -y1*sinx + z1*cosx;
290 x1 = x*cosy - z*siny;
292 z1 = x*siny + z*cosy;
312 P->
x = (P->
x + P->
z / 2) * scale + x;
313 P->
y = (P->
y - P->
z / 2) * scale + y;
329 for(d=0;d<=360;d+=45)
Master include file for project Includes all project includes and defines here.
MEMSPACE void shift_point(point *P, point *shift)
Shift x,y,z by shift.
Cordic_T X
Main Cordic routine - used for basic trig and vector rotations We use fixed point numbers...
MEMSPACE double deg2rad(double deg)
Convert Degrees to Rads.
MEMSPACE void cordic_deg(double deg, double *s, double *c)
Compute Sin and Cos from angle in degrees using Cordic.
MEMSPACE void cordic_rad(double rad, double *s, double *c)
Compute Sin and Cos from angle in Rads using Cordic.
MEMSPACE void PerspectiveProjection(point *P, double scale, int x, int y)
Cordic Routines Handle angle outside of the first quadrant Added standalone test to verify CORDIC aga...
MEMSPACE void scale_point(point *P, double scale)
Scale x,y,z by scale factor.
int main(int argc, char *argv[])
const Cordic_T v_atangrad[]
Math IO functions, and verious conversion code with floating point support.
MEMSPACE int printf(const char *format,...)
MEMSPACE void cordic_quad(double angle, double *s, double *c)
Compute Sin and Cos from angle in quads using Cordic.
MEMSPACE double angle_quad(double quads, int *quad)
Compute quadrant of angle and the quadrant modulus Note: Integer part is quadrant.
void Circular(Cordic_T x, Cordic_T y, Cordic_T z)
MEMSPACE void rotate(point *P, point *V)
Rotate point P by View point.