While doing some calculations in Visual Studio C++ I found the final value of angle
to be -1.#IND000000000000
What does this value mean? Has it gone out of scope?
Following is the code I was trying to implement How do I calculate arc angle between two points on a circle? from this formula
cos-1 ((x1x2 + y1y2 + z1z2) / r2) as mentioned here
CODE
double x = vec1X * vec2X;
double y = vec1Y * vec2Y;
double r = sqrt(((vec2X - originX) * (vec2X - originX))+((vec2Y - originY) * (vec2Y - originY)));
angle = acos ((x + y) / r*r);
Sample values to reproduce error
vec1X = 91.094001770019531;
vec1Y = 147.74990844726562;
vec2X = 94.163322448730469;
vec2Y = 187.93711853027344;
originX = 136.79920959472656;
originY = 223.69624328613281;