hello guys,

in my program, i need to get the angle between two normals.
i first get the dot product of the two normals and use acos to get the actual angle.

the code is rather simple like this:

float dot=Math:ot(normal1,normal2);
printf("dot in2:%f\n",dot);
angle=acos(dot);
printf("angle1:%f\n",angle);


i got the output:

dot in2:1.000000
angle1:-1.#IND00


the weird thing is that the infinite result doesn't always happen when the dot is 1.000000. for example, one of the outputs was:

dot in2:1.000000
angle1:0.000598

so i guess the float is rounded when being outputted.
although in both cases, the dot values are 1, i guess they are not.


and i also tried acos(1), the result is 0, not -1.#IND

now i'm wondering, is that true the function acos can return -1.#IND.

how can i avoid that?

thank you.