hi 3DGS.
i don`t know if it is a bug or some thing...
when i want to get hight of a triangle,i use the method in the manual:
VECTOR pointA;
VECTOR pointB;
VECTOR pointC;
//these 3 points define a triangle(of course their Z is all the same)
VECTOR vec_A_to_B;
VECTOR vec_A_to_C;
VECTOR vec_B_to_C;
//these 3 vectors means 3 lines of the triangle
var angle_A = acos(vec_dot(vec_A_to_B,vec_A_to_C)/(vec_length(vec_A_to_B)*vec_length(vec_A_to_C)));
var hight_B = vec_length(vec_A_to_B) * sinv(angle_A);
and i found that the value of hight_B is bigger than the right value
then i use Cosine Theorem:
var cos_A=(vec_A_to_B^2 + vec_A_to_C^2 - vec_B_to_C^2)/(2 * vec_A_to_B * vec_A_to_C);
angle_A = acos(A);
hight_B = vec_length(vec_A_to_B) * sinv(angle_A);
i found that the value of hight_B is smaller than the right value
only when i don`t use acos() function:
hight_B = sqrt(vec_A_to_B^2 - (vec_A_to_B * cosA)^2);
this value of hight_B is the right value...and i really don`t know why..
thanks for read this,hope to get your answers!