3 #include FT_TRIGONOMETRY_H 8 #define PI 3.14159265358979323846 9 #define SPI (PI/FT_ANGLE_PI) 34 printf(
"FT_Cos[%3d] = %.7f cos[%3d] = %.7f\n",
35 (i >> 16), f1/65536.0, (i >> 16), d2 );
59 printf(
"FT_Sin[%3d] = %.7f sin[%3d] = %.7f\n",
60 (i >> 16), f1/65536.0, (i >> 16), d2 );
83 printf(
"FT_Tan[%3d] = %.7f tan[%3d] = %.7f\n",
84 (i >> 16), f1/65536.0, (i >> 16), d2 );
112 if (
abs( i - j ) > 1 )
114 printf(
"FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\n",
115 c2/65536.0, s2/65536.0, j/65536.0, i/65536.0 );
141 printf(
"FT_Vector_Unit[%3d] = ( %.7f, %.7f ) vec = ( %.7f, %.7f )\n",
143 v.
x/65536.0, v.
y/65536.0,
167 printf(
"FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\n",
168 v.
x/65536.0, v.
y/65536.0, l2/65536.0, l/65536.0 );
179 double l, ra,
a, c1,
s1, cra, sra, c3, s3;
182 for ( rotate = 0; rotate <
FT_ANGLE_2PI; rotate += 0x10000 )
201 c3 = c1 * cra - s1 * sra;
202 s3 = c1 * sra + s1 * cra;
211 printf(
"FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\n",
213 c2/65536.0, s2/65536.0,
214 c4/65536.0, s4/65536.0 );
232 printf(
"trigonometry test ok !\n" );
GLboolean GLboolean GLboolean GLboolean a
local void rotate(unsigned char *list, unsigned len, unsigned rot)
FT_Atan2(FT_Fixed x, FT_Fixed y)
FT_Vector_Unit(FT_Vector *vec, FT_Angle angle)
FT_Vector_Rotate(FT_Vector *vec, FT_Angle angle)
FT_Vector_Length(FT_Vector *vec)