I’m trying to find the full 360 degree angle between 3 points. I found this formula in another post which tells me the angle between my 3 points but when the angle goes over 180 it starts lowering afterwards. I know why this is happening but I can’t seem to find out how to fix it since I’m not a galaxy brain mathematician.
Here’s the formula:
local A = workspace.A
local B = workspace.B
local C = workspace.C
local BA = (A.Position - B.Position).Unit
local BC = (C.Position - B.Position).Unit
local angle = math.acos(BA:Dot(BC))
print(angle)
The formula you found gives the “minimum” angle between the lines formed by your points. In order to create a distinction between, say, 90 and -90, you need additional information which you can add by taking the cross product.
However for this to work you must have a defined “up” direction around which angles are assumed to be measured around. This will be the case if your points are always on the same plane, or can be projected on to the same plane. For example, if your points have a height along the Y-axis, but you don’t care what it is, and you want two points with the same X and Z coordinates to behave the same, then you also meet this requirement.
Does this line up with what you want? If so let me know and I will explain cross product method in more detail.