Does CC use -Pi to Pi (or -2Pi to 2Pi) for radian measurements? Or does it use continuous scale from -inf to inf?
Right now, I've got a script that measures the angle of incidence and sees if a particle's heading is going within Pi/2 of a normal, but for some reason it does not work for angles going about Pi/3 from normal in the first quadrant.
Here's my detection script.
Code:
local normal = math.atan2(-((self.Pos.Y) - particle.Pos.Y), (self.Pos.X - particle.Pos.X));
local particleHeading = math.atan2(-(particle.Vel.Y), (particle.Vel.X));
if math.abs(math.pi + normal - (particleHeading + math.pi)) < (math.pi/2) then
I thought it was -Pi to Pi, which is why I added math.pi to both sides to make both positive measurements.