#include <ft2build.h>
#include <math.h>
#include <stdio.h>
Go to the source code of this file.
◆ PI
#define PI 3.14159265358979323846 |
◆ SPI
◆ THRESHOLD
◆ main()
Definition at line 244 of file test_trig.c.
245 {
253
255 printf(
"trigonometry test ok !\n" );
256
258 }
static void test_cos(void)
static void test_rotate(void)
static void test_length(void)
static void test_sin(void)
static void test_atan2(void)
static void test_unit(void)
static void test_tan(void)
◆ test_atan2()
Definition at line 96 of file test_trig.c.
97 {
99
100
102 {
106
107
110
113
116
120
121 if (
abs(
i -
j ) > 1 )
122 {
123 printf(
"FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\n",
124 c2/65536.0,
s2/65536.0,
j/65536.0,
i/65536.0 );
125 }
126 }
127 }
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
FT_Atan2(FT_Fixed x, FT_Fixed y)
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Referenced by main().
◆ test_cos()
Definition at line 18 of file test_trig.c.
19 {
21
22
24 {
26 double d2;
27
28
32
34 {
36 printf(
"FT_Cos[%3d] = %.7f cos[%3d] = %.7f\n",
37 (
i >> 16),
f1/65536.0, (
i >> 16), d2 );
38 }
39 }
40 }
Referenced by main().
◆ test_length()
Definition at line 164 of file test_trig.c.
165 {
167
168
170 {
173
174
179
181 {
183 printf(
"FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\n",
184 v.x/65536.0,
v.y/65536.0, l2/65536.0,
l/65536.0 );
185 }
186 }
187 }
FT_Vector_Length(FT_Vector *vec)
Referenced by main().
◆ test_rotate()
Definition at line 191 of file test_trig.c.
192 {
194
195
197 {
198 double ra, cra, sra;
200
201
205
207 {
210 double l,
a, c1,
s1, c3, s3;
211
212
215
218
221
223
224 c3 = c1 * cra -
s1 * sra;
225 s3 = c1 * sra +
s1 * cra;
226
229
232 {
234 printf(
"FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\n",
236 c2/65536.0,
s2/65536.0,
237 c4/65536.0, s4/65536.0 );
238 }
239 }
240 }
241 }
_STLP_MOVE_TO_STD_NAMESPACE void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
FT_Vector_Rotate(FT_Vector *vec, FT_Angle angle)
Referenced by main().
◆ test_sin()
Definition at line 44 of file test_trig.c.
45 {
47
48
50 {
52 double d2;
53
54
58
60 {
62 printf(
"FT_Sin[%3d] = %.7f sin[%3d] = %.7f\n",
63 (
i >> 16),
f1/65536.0, (
i >> 16), d2 );
64 }
65 }
66 }
Referenced by main().
◆ test_tan()
Definition at line 70 of file test_trig.c.
71 {
73
74
76 {
78 double d2;
79
80
84
86 {
88 printf(
"FT_Tan[%3d] = %.7f tan[%3d] = %.7f\n",
89 (
i >> 16),
f1/65536.0, (
i >> 16), d2 );
90 }
91 }
92 }
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
Referenced by main().
◆ test_unit()
Definition at line 131 of file test_trig.c.
132 {
134
135
137 {
141
142
149
152 {
154 printf(
"FT_Vector_Unit[%3d] = ( %.7f, %.7f ) vec = ( %.7f, %.7f )\n",
156 v.x/65536.0,
v.y/65536.0,
158 }
159 }
160 }
FT_Vector_Unit(FT_Vector *vec, FT_Angle angle)
Referenced by main().
◆ error