summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eina/eina_matrix.c')
-rw-r--r--src/lib/eina/eina_matrix.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/eina/eina_matrix.c b/src/lib/eina/eina_matrix.c
index 1c848f3..7c30d1e 100644
--- a/src/lib/eina/eina_matrix.c
+++ b/src/lib/eina/eina_matrix.c
@@ -542,9 +542,17 @@ EAPI void
542eina_matrix3_rotate(Eina_Matrix3 *m, double rad) 542eina_matrix3_rotate(Eina_Matrix3 *m, double rad)
543{ 543{
544 double c, s; 544 double c, s;
545#if 0 545
546 c = cosf(rad); 546 /* Note: Local functions do not guarantee accuracy.
547 s = sinf(rad); 547 * Errors occur in the calculation of very small or very large numbers.
548 * Local cos and sin functions differ from the math header cosf and sinf functions
549 * by result values. The 4th decimal place is different.
550 * But local functions are certainly faster than functions in math library.
551 * Later we would want someone to look at this and improve accuracy.
552 */
553#if 1
554 c = cos(rad);
555 s = sin(rad);
548#else 556#else
549 /* normalize the angle between -pi,pi */ 557 /* normalize the angle between -pi,pi */
550 rad = fmod(rad + M_PI, 2 * M_PI) - M_PI; 558 rad = fmod(rad + M_PI, 2 * M_PI) - M_PI;