LSSTApplications  12.1-5-gbdcc3ab+2,15.0+13,15.0+26,15.0-1-g19261fa+17,15.0-1-g60afb23+26,15.0-1-g615e0bb+18,15.0-1-g788a293+26,15.0-1-ga91101e+26,15.0-1-gae1598d+12,15.0-1-gd076f1f+24,15.0-1-gdf18595+5,15.0-1-gf4f1c34+12,15.0-11-g7db6e543+4,15.0-12-g3681e7a+4,15.0-15-gc15de322,15.0-16-g83b84f4,15.0-2-g100d730+19,15.0-2-g1f9c9cf+4,15.0-2-g8aea5f4+1,15.0-2-gf38729e+21,15.0-29-ga12a2b06e,15.0-3-g11fe1a0+14,15.0-3-g707930d+3,15.0-3-g9103c06+12,15.0-3-gd3cbb57+3,15.0-4-g2d82b59,15.0-4-g535e784+10,15.0-4-g92ca6c3+4,15.0-4-gf906033+2,15.0-5-g23e394c+14,15.0-5-g4be42a9,15.0-6-g69628aa,15.0-6-g86e3f3d+1,15.0-6-gfa9b38f+4,15.0-7-g949993c+3,15.0-8-g67a62d3+1,15.0-8-gcf05001+1,15.0-9-g1e7c341+1,w.2018.21
LSSTDataManagementBasePackage
Public Member Functions | Friends | List of all members
lsst::afw::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...
 

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 52 of file Angle.h.

Constructor & Destructor Documentation

◆ AngleUnit()

constexpr lsst::afw::geom::AngleUnit::AngleUnit ( double  val)
inlineexplicit

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 67 of file Angle.h.

67 : _val(val) {}
ImageT val
Definition: CR.cc:158

Member Function Documentation

◆ operator==()

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

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 83 of file Angle.h.

83  {
84  return (_val == rhs._val);
85 }

Friends And Related Function Documentation

◆ Angle

friend class Angle
friend

Definition at line 53 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 364 of file Angle.h.

364  {
365  static_assert(std::is_arithmetic<T>::value,
366  "Only numeric types may be multiplied by an AngleUnit to create an Angle!");
367  return Angle(lhs * rhs._val);
368 }
friend class Angle
Definition: Angle.h:53

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