lsst.geom g3f8e1907dc+2986c7237a
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
lsst::geom::AngleUnit Class Referencefinal

A class used to convert scalar POD types such as double to Angle. More...

#include <Angle.h>

Public Member Functions

constexpr AngleUnit (double val)
 Define a new angle unit. More...
 
constexpr bool operator== (AngleUnit const &rhs) const noexcept
 Test if two units are the same. More...
 
std::size_t hash_value () const noexcept
 Return a hash of this object. More...
 

Friends

class Angle
 
template<typename T >
constexpr Angle operator* (T lhs, AngleUnit rhs) noexcept
 Use AngleUnit to convert a POD (e.g. int, double) to an Angle; e.g. 180*degrees. More...
 

Detailed Description

A class used to convert scalar POD types such as double to Angle.

For example, given the predefined AngleUnit degrees:

Angle pi = 180*degrees;

is equivalent to

Angle pi(180, degrees);

Definition at line 71 of file Angle.h.

Constructor & Destructor Documentation

◆ AngleUnit()

constexpr lsst::geom::AngleUnit::AngleUnit ( double  val)
inlineexplicitconstexpr

Define a new angle unit.

Parameters
valthe number of radians in one unit. See degrees for an example.
Exception Safety
Provides strong exception safety.

Definition at line 86 of file Angle.h.

Member Function Documentation

◆ hash_value()

std::size_t lsst::geom::AngleUnit::hash_value ( ) const
inlinenoexcept

Return a hash of this object.

Definition at line 99 of file Angle.h.

◆ operator==()

constexpr bool lsst::geom::AngleUnit::operator== ( AngleUnit const &  rhs) const
inlineconstexprnoexcept

Test if two units are the same.

Parameters
rhsthe unit to compare this to
Returns
true if the two units have the same size, false otherwise.
Exception Safety
Shall not throw exceptions.

Definition at line 105 of file Angle.h.

Friends And Related Function Documentation

◆ Angle

friend class Angle
friend

Definition at line 72 of file Angle.h.

◆ operator*

template<typename T >
constexpr Angle operator* ( lhs,
AngleUnit  rhs 
)
friend

Use AngleUnit to convert a POD (e.g. int, double) to an Angle; e.g. 180*degrees.

Parameters
lhsthe value to convert
rhsthe conversion coefficient
Exception Safety
Shall not throw exceptions.

Definition at line 402 of file Angle.h.


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