#include <angles.h>
Angles provides a common interface for generating directions: i.e., two angles that should be interpreted as azimuthal and polar angles.
Classes | |
| struct | InvalidTheta |
Public Member Functions | |
| Angles () | |
| Default constructor. More... | |
| Angles (double ph, double cost) | |
| void | distribute_isotropically () |
| Populate the object with a new direction. More... | |
| void | set_phi (const double phi) |
| Sets the azimuthal angle. More... | |
| void | set_costheta (const double cos) |
| Set the polar angle from its cosine. More... | |
| void | set_theta (const double theta) |
| Set the polar angle. More... | |
| bool | add_to_theta (const double delta) |
| Advance polar angle. More... | |
| bool | add_to_theta (const double delta, const bool reverse) |
| Advance polar angle. More... | |
| double | phi () const |
| double | costheta () const |
| double | sintheta () const |
| double | x () const |
| double | y () const |
| double | z () const |
| ThreeVector | threevec () const |
| double | theta () const |
Private Attributes | |
| double | phi_ |
| Azimuthal angle \(\varphi\). More... | |
| double | costheta_ |
| Cosine of polar angle \(\cos\vartheta\). More... | |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the polar angle from its cosine.
This is the preferred way of setting the polar information.
| [in] | cos | Cosine of the polar angle \(\cos\vartheta\). |
| InvalidTheta | If cos is not in range [-1 .. 1]. |
Definition at line 202 of file angles.h.
|
inline |
Set the polar angle.
In the current implementation, costheta is stored inside the object. Don't convert the angle to and from cosine, use the set-function for the thing you have at hand.
| [in] | theta | Any real number to set the polar angle \(\vartheta\) to. |
Definition at line 218 of file angles.h.
|
inline |
Advance polar angle.
A positive addition means that we go towards the southpole.
| [in] | delta | Angle increment. |
| InvalidTheta | If delta is not in [ \(-\pi\) .. \(\pi\)]. |
Definition at line 224 of file angles.h.
|
inline |
Advance polar angle.
When crossing a pole, azimuthal angle is changed by 180 degrees.
| [in] | delta | Angle increment. |
| [in] | reverse | If true, we start in the "far" hemisphere, meaning a positive delta will shift the object towards the north pole. |
| InvalidTheta | If delta is not in [ \(-\pi\) .. \(\pi\)]. |
Definition at line 249 of file angles.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |