lsst.sphgeom g161b0bc589+ac198e9f13
Public Member Functions | Static Public Member Functions | List of all members
lsst::sphgeom::NormalizedAngle Class Reference

#include <NormalizedAngle.h>

Public Member Functions

 NormalizedAngle ()=default
 This constructor creates a NormalizedAngle with a value of zero.
 
 NormalizedAngle (NormalizedAngle const &a)=default
 This constructor creates a copy of a.
 
 NormalizedAngle (Angle const &a)
 This constructor creates a normalized copy of a.
 
 NormalizedAngle (double a)
 
 NormalizedAngle (LonLat const &, LonLat const &)
 
 NormalizedAngle (Vector3d const &, Vector3d const &)
 
 operator Angle const & () const
 
bool operator== (Angle const &a) const
 
bool operator!= (Angle const &a) const
 
bool operator< (Angle const &a) const
 
bool operator> (Angle const &a) const
 
bool operator<= (Angle const &a) const
 
bool operator>= (Angle const &a) const
 
Angle operator- () const
 
Angle operator+ (Angle const &a) const
 
Angle operator- (Angle const &a) const
 
Angle operator* (double a) const
 
Angle operator/ (double a) const
 
double operator/ (Angle const &a) const
 
double asDegrees () const
 asDegrees returns the value of this angle in units of degrees.
 
double asRadians () const
 asRadians returns the value of this angle in units of radians.
 
bool isNan () const
 isNan returns true if the angle value is NaN.
 
NormalizedAngle getAngleTo (NormalizedAngle const &a) const
 

Static Public Member Functions

static NormalizedAngle nan ()
 
static NormalizedAngle fromDegrees (double a)
 
static NormalizedAngle fromRadians (double a)
 
static NormalizedAngle between (NormalizedAngle const &a, NormalizedAngle const &b)
 
static NormalizedAngle center (NormalizedAngle const &a, NormalizedAngle const &b)
 

Detailed Description

NormalizedAngle is an angle that lies in the range [0, 2π), with one exception - a NormalizedAngle can be NaN.

Constructor & Destructor Documentation

◆ NormalizedAngle() [1/3]

lsst::sphgeom::NormalizedAngle::NormalizedAngle ( double  a)
inlineexplicit

This constructor creates a NormalizedAngle with the given value in radians, normalized to be in the range [0, 2π).

◆ NormalizedAngle() [2/3]

lsst::sphgeom::NormalizedAngle::NormalizedAngle ( LonLat const &  p1,
LonLat const &  p2 
)

This constructor creates a NormalizedAngle equal to the angle between the given points on the unit sphere.

◆ NormalizedAngle() [3/3]

lsst::sphgeom::NormalizedAngle::NormalizedAngle ( Vector3d const &  v1,
Vector3d const &  v2 
)

This constructor creates a NormalizedAngle equal to the angle between the given 3-vectors, which need not have unit norm.

Member Function Documentation

◆ between()

NormalizedAngle lsst::sphgeom::NormalizedAngle::between ( NormalizedAngle const &  a,
NormalizedAngle const &  b 
)
static

For two angles a and b, between(a, b) returns the smaller of a.getAngleTo(b) and b.getAngleTo(a). The result will be in the range [0, π].

If one interprets an angle in [0, 2π) as a point on the unit circle, then between can be thought of as computing the arc length of the shortest unit circle segment between the points for a and b.

◆ center()

NormalizedAngle lsst::sphgeom::NormalizedAngle::center ( NormalizedAngle const &  a,
NormalizedAngle const &  b 
)
static

For two normalized angles a and b, center(a, b) returns the angle m such that a.getAngleTo(m) is equal to m.getAngleTo(b).

◆ getAngleTo()

NormalizedAngle lsst::sphgeom::NormalizedAngle::getAngleTo ( NormalizedAngle const &  a) const
inline

getAngleTo computes the angle α ∈ [0, 2π) such that adding α to this angle and then normalizing the result yields a.

If one interprets an angle in [0, 2π) as a point on the unit circle, then this method can be thought of as computing the positive rotation angle required to map this point to a.

◆ operator Angle const &()

lsst::sphgeom::NormalizedAngle::operator Angle const & ( ) const
inline

This conversion operator returns a const reference to the underlying Angle. It allows a NormalizedAngle to transparently replace an Angle as an argument in most function calls.


The documentation for this class was generated from the following files: