samskivert / pythagoras

A portable library of geometry classes for Java
Apache License 2.0
44 stars 14 forks source link

Bugfix in f.MathUtil.mirrorAngle #20

Closed cdietze closed 11 years ago

samskivert commented 11 years ago

Actually, I was thinking about the code more and looked at the new mirrorAngleOrigin and it's not correct.

It's correct for PI/2 and -PI/2 but that's about it. -PI gets "mirrored" to 0 which is certainly not a mirroring about the x-axis.

I think a mirror about the x-axis for an angle between -PI and PI is simply -angle. So maybe this mirrorAngleOrigin method is erroneous. It certainly doesn't do anything predictable right now, so I think I'm going to remove it.

cdietze commented 11 years ago

Thinking more about it, I guess the code is fine but does something completely different than what we talked about. It does not mirror / reflect about any axis. It actually returns the opposite angle (rotating forward or backward by PI). My first intention was that this is "mirroring" at the origing. I guess a clearer name for it would be oppositeAngle.

Sorry for the confusion.