GalSim-developers/GalSim — pull request #138 by rmjarvis (2012-05-08 13:55:53+00:00)
Title: #111 Angle class for cleaner use of angles in the code. Take 2

Take 2 on the request for code review of the new Angle class. (I had a git snafu for the first one.) Again, here is the dox for Angle:

```
* @brief A class representing an Angle
*
* Angles are a value with an AngleUnit.
*
* You typically create an Angle by multiplying a number by an Angle Unit.
* e.g.
* @code
* Angle pixel = 0.27 * arcsec;
* Angle ra = 13.4 * hours;
* Angle dec = -32 * degrees;
* Angle theta = PI/2 * radians;
* @endcode
*
* You can also use the constructor explicitly, which takes a value and a unit:
* @code
* Angle theta(90, degrees);
* @endcode
*
* Since extracting the value in radians is extremely common, we have an accessor
* to do this quickly:
* @code
* x = theta.rad();
* @endcode
* It is equivalent to the more verbose:
* @code
* x = theta / radians;
* @endcode
* but without actually requiring the FLOP of dividing by 1.
*
* Arithmetic with Angles include the following:
* (In the list below, x is a double, unit is an AngleUnit, and theta is an Angle.)
* @code
* theta = x * unit
* x = theta / unit
* theta3 = theta1 + theta2
* theta3 = theta1 - theta2
* theta2 = theta1 * x
* theta2 = x * theta1
* theta2 = theta1 / x
* theta2 += theta1
* theta2 -= theta1
* theta *= x
* theta /= x
* @endcode
*
* I/O:
* @code os << theta @endcode just outputs the value in radians.
```