eina_matrix: replace cosf by cos to gain more accuracy

Summary:
cos function is much much more accurate than cosf.
this patch replaces cosf by cos to gain more accuracy.

Reviewers: cedric, jsuya, vtorri

Subscribers: vtorri, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10695
This commit is contained in:
Wonki Kim 2019-11-21 17:43:42 +09:00 committed by JunsuChoi
parent 5eab3bff68
commit 4a4525cb4b
2 changed files with 4 additions and 4 deletions

View File

@ -551,8 +551,8 @@ eina_matrix3_rotate(Eina_Matrix3 *m, double rad)
* Later we would want someone to look at this and improve accuracy.
*/
#if 1
c = cosf(rad);
s = sinf(rad);
c = cos(rad);
s = sin(rad);
#else
/* normalize the angle between -pi,pi */
rad = fmod(rad + M_PI, 2 * M_PI) - M_PI;

View File

@ -463,8 +463,8 @@ EFL_START_TEST(eina_matrix3_operations)
fail_if (!MATRIX3_CMP(m1.xx, m1.xy, m1.xz,
m1.yx, m1.yy, m1.yz,
m1.zx, m1.zy, m1.zz,
cosf(rotate_radian), -sinf(rotate_radian), 0,
sinf(rotate_radian), cosf(rotate_radian), 0,
cos(rotate_radian), -sin(rotate_radian), 0,
sin(rotate_radian), cos(rotate_radian), 0,
0, 0, 1));
eina_matrix3_values_set(&m1,