forked from enlightenment/efl
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:
parent
5eab3bff68
commit
4a4525cb4b
|
@ -551,8 +551,8 @@ eina_matrix3_rotate(Eina_Matrix3 *m, double rad)
|
||||||
* Later we would want someone to look at this and improve accuracy.
|
* Later we would want someone to look at this and improve accuracy.
|
||||||
*/
|
*/
|
||||||
#if 1
|
#if 1
|
||||||
c = cosf(rad);
|
c = cos(rad);
|
||||||
s = sinf(rad);
|
s = sin(rad);
|
||||||
#else
|
#else
|
||||||
/* normalize the angle between -pi,pi */
|
/* normalize the angle between -pi,pi */
|
||||||
rad = fmod(rad + M_PI, 2 * M_PI) - M_PI;
|
rad = fmod(rad + M_PI, 2 * M_PI) - M_PI;
|
||||||
|
|
|
@ -463,8 +463,8 @@ EFL_START_TEST(eina_matrix3_operations)
|
||||||
fail_if (!MATRIX3_CMP(m1.xx, m1.xy, m1.xz,
|
fail_if (!MATRIX3_CMP(m1.xx, m1.xy, m1.xz,
|
||||||
m1.yx, m1.yy, m1.yz,
|
m1.yx, m1.yy, m1.yz,
|
||||||
m1.zx, m1.zy, m1.zz,
|
m1.zx, m1.zy, m1.zz,
|
||||||
cosf(rotate_radian), -sinf(rotate_radian), 0,
|
cos(rotate_radian), -sin(rotate_radian), 0,
|
||||||
sinf(rotate_radian), cosf(rotate_radian), 0,
|
sin(rotate_radian), cos(rotate_radian), 0,
|
||||||
0, 0, 1));
|
0, 0, 1));
|
||||||
|
|
||||||
eina_matrix3_values_set(&m1,
|
eina_matrix3_values_set(&m1,
|
||||||
|
|
Loading…
Reference in New Issue