Angle

Author: Adrian

Description
This is a helper class that greatly simplifies working with euler angles. It allows to calculate with angles using regular operators, compare angles with each other and automatically wraps angles. The class supports both degree and radian and will try guess the type when calculating or comparing with float values.

Usage
Angle supports both degrees and radians. When creating an Angle, you can specify the type of the Angle or use Angle's default mode.

Angles automatically convert their type so it's possible to mix radians and degrees.

It's possible to mix regular float values with Angles. Float values will be assumed to be the same type as the Angle they interact with.

When comparing angles, wrapping will be considered. The circle is split into two parts and an Angle is less if it's inside the left-hand part and bigger if it's inside the right-hand part. Smaller and bigger than, will neither match the same nor the opposite Angle, smaller and equal or bigger and equal with, both math the same and the opposite Angle.

Supported Operations
Following operations are supported.

Methods
Angle objects support following operations:

Installation
To be able to use Angle from all your classes (JavaScript, Boo and C#), it's best to put it into your "Standard Assets/Scripts" folder.

History
Fixed a bug in Angle.Diffrence(Angle), now wraps correctly and never exceeds 180 degrees. Initial release
 * 4. May 2008
 * 13. April 2008