Message 1 of 5
angleTo() returning unexpected result for rotated vector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm working with AutoCAD 2025 and the ObjectARX C++ API.
I have the following setup:
v1({0.00000, 0.86603, 0.50000}) is the original directional vector.
v2({-0.50000, -0.75000, -0.43301}) is v1 after being rotated using the AutoCAD ROTATE command by 150 degrees.
v3({0.86603, -0.43301, -0.25000}) is the normal vector (axis of rotation).
I'm using the angleTo() function like this:
double angle = v1.angleTo(v2, v3); // expecting ~150 degrees in radians
However, the result I'm getting seems to be 2π - expected angle, i.e., ~210 degrees instead of 150 degrees (in radians).
Is this the expected behavior of angleTo() in certain vector orientations, or am I missing something regarding vector direction or rotation axis?
Would appreciate any clarification or tips on handling this.
Thanks in advance!