A combo of AngleBetween (2D) and CyclesToRadians outputs incorrect value

Here’s an example:

AngleBetween-issue.vl (10.3 KB)

If the point is at the left of the origin, it should output π. But it outputs 0.

This has been raised earlier here and here but those posts have been auto-closed.

I discovered that Slope node exists which seem to behave correctly. But the existence of AngleBetween causes confusion. When is AngleBetween useful over Slope?

AngleBetween inputs are for directions (vectors), not points.

So I think your intention setup would be (1;0) and (-1,0) to prompt the angle for a full hemicycle between right and left of origin.
In this case you will see a correct output of -0.50 cycles = -PI :)

EDIT: corrected wrong values in my example

Thanks for replying!

So what you mean is that AngleBetween is mainly used for normalized, unit
vectors
?

I tried the other way around as your suggested, and swapped From Direction and To Direction, but it is still giving me zero. Am I doing something wrong?

@ajitid the vector (0,0) has a length of 0 and thus no direction.
Play around with the help patch (F1) and put the mouse controlled vector in the center.

Sune

2 Likes

The don’t have to be normalized.
Direction is the length of the vector on x and y axis.

My initial message was wrong indeed.
To test for PI you would input (1;0) and (-1;0). This would give -PI properly :)
Sorry for the mistake in my initial message.

If one of your Directions is (0;0) like you are trying, it means one of the two vectors forming your angle is null, thus the result is undefined and not reliable.

1 Like

Thanks TremensS and sunep for helping me make it understand!

Closing this ticket as it is not a bug.

2 Likes