[V8i VBA] Vector3dPolarAngle Method - Result inverse of expected, why?

Simple test case above, I have a vector and I am using Vector3dPolarAngle to access the existing rotation of the vector. My understanding is the angle returned is calculated counter-clockwise from the x-axis yet the value provided as viewed in locals window/debug.print is measured clockwise from the x-axis. Is this a bug or an accepted feature of this particular method?

Dim UnitNormal                            As Vector3d
UnitNormal = Vector3dNormalize(Vector3dSubtractPoint3dPoint3d(SourceCoordinate, ProjectedPoint))
Dim AngleRadians As Double
AngleRadians = Vector3dPolarAngle(UnitNormal)

  • Unknown said:
    The value provided as viewed in locals window/debug.print is measured clockwise from the x-axis.

    The number is negative.  It's not really the inverse, just another way of presenting the result.  Subtract from 2π to get the anti-clockwise value.  Depending on the algorithms used, this kind of result can happen when an angle is greater than 180°.  It's a consequence of the periodic (cyclical) nature of the sin() and cos() functions.  That's another reason to prefer working with matrices over angles, especially in 3D.  Unfortunately most people can't interpret a rotation matrix: I blame the government.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Barry Lothian 

  • Unknown said:

    Unfortunately most people can't interpret a rotation matrix: I blame the government.

    Yes, I certainly don't recall it being on my secondary school mathematics curriculum though I do wish it was. It would have made my progression into programming somewhat easier.

    I do already have a function for converting the angle result, I was just curious why the output value didn't follow the convention of CCW rotation however the point is indeed moot.