- Joined
- Oct 16, 2007
- Messages
- 1,886
- Reaction score
- 11
- Points
- 0
- Location
- USA-WA
- Website
- www.orbiter-forum.com
is this a correct statement?
also does this actually turn rad to degrees
Code:
float get_angle_between_in_radians(long double ax, long double ay, long double az, long double bx, long double by, long double bz)
{
float pi = 3.14159265358979323846;
float dotproduct, lengtha, lengthb, result;
dotproduct = (ax * bx) + (ay * by) + (az * bz);
lengtha = sqrt(ax * ax + ay * ay + az * az);
lengthb = sqrt(bx * bx + by * by + bz * bz);
result = acos( dotproduct / (lengtha * lengthb) );
if(dotproduct < 0)
{
if(result > 0)
result += pi;
else
result -= pi;
}
return result;
}
also does this actually turn rad to degrees
Code:
y = y * (57.29577951);