Basically I am trying to calculate the angle between the ships direction vector, and the nav point to decide how many radians to turn the ship on that plane. Can any of you guys spot why the acos function doesn't return a 90 degree angle?

Knowing that vDirX is (1,0), vNavX is (0,0) and vDirY is (0, 0) and vNavY is (0,0):

D3DXVec2Normalize(&vNavX,&vNavX);

D3DXVec2Normalize(&vNavY,&vNavY);

float anglex = acos( ((vNavX.y * vDirX.y)+(vNavX.x * vDirX.x)) / (D3DXVec2Length(&vNavX) * D3DXVec2Length(&vDirX)) );

float angley = acos( ((vNavY.y * vDirY.y)+(vNavY.x * vDirY.x)) / (D3DXVec2Length(&vNavY) * D3DXVec2Length(&vDirY)) );

Why is acos returning me -1.#IND000 for both angles?

Thanks a lot guys if you can help me....