Finding angle in one direction (above 180)


#1

I’ve found several methods for finding the angle between points up to 180 (disregarding direction).
abs(acos (dot (normalize (p1-[0,0,0])) (normalize (p2-[0,0,0]))))

But I can’t figure out how I can specify that I want to retrieve the angle in one direction, so that it can go past 180 degrees. What kind of modification would I need to do so that it returns the angle in one direction, or possibly returning both directions?

EDIT: So I figured out that I could just return (360-degrees) if p2.x is negative, which works. But if there’s a better way to just return both sides of an angle I’m all ears :slight_smile:


#2

what you are finding called Azimuth angle
it’s an angle in [-180,180) , when you want a angle more than 180 or below -180 , just use 360 to get it
atan2() gives the method


#3

you need to test for reflex or obtuse, that is if the vector is above or below the the plane of the other vector… so you test whether the “end point” of the second vector is above or below the plane of the first vector