gramods
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gramods::gmCore::angle Struct Reference

A simple placeholder for angle values expressed in radians. More...

#include <io_angle.hh>

Collaboration diagram for gramods::gmCore::angle:
Collaboration graph
[legend]

Public Member Functions

 angle (float v)
 
void deg (float v)
 Set the angle, in degrees. More...
 
float deg ()
 The angle, in degrees. More...
 
void rad (float v)
 Set the angle, in radians. More...
 
float rad ()
 The angle, in radians. More...
 
void operator= (float v)
 Set the value of the angle, in radians. More...
 
 operator float ()
 Cast the angle type to float, still in radians. More...
 

Public Attributes

float value
 The angle in radians. More...
 

Static Public Attributes

static constexpr float from_degrees = (float)(GM_PI / 180.0)
 Multiplier to convert from degrees to radians. More...
 
static constexpr float to_degrees = (float)(180.f / GM_PI)
 Multiplier to convert from radians to degrees. More...
 

Detailed Description

A simple placeholder for angle values expressed in radians.

For convenience there are means available for converting to and from degrees, and there is a stream operator defined that allows angles to be expressed in degrees by prepending a 'd', as in d180.

Member Function Documentation

◆ deg() [1/2]

float gramods::gmCore::angle::deg ( )
inline

The angle, in degrees.

◆ deg() [2/2]

void gramods::gmCore::angle::deg ( float  v)
inline

Set the angle, in degrees.

◆ operator float()

gramods::gmCore::angle::operator float ( )
inline

Cast the angle type to float, still in radians.

◆ operator=()

void gramods::gmCore::angle::operator= ( float  v)
inline

Set the value of the angle, in radians.

◆ rad() [1/2]

float gramods::gmCore::angle::rad ( )
inline

The angle, in radians.

◆ rad() [2/2]

void gramods::gmCore::angle::rad ( float  v)
inline

Set the angle, in radians.

Member Data Documentation

◆ from_degrees

constexpr float gramods::gmCore::angle::from_degrees = (float)(GM_PI / 180.0)
staticconstexpr

Multiplier to convert from degrees to radians.

◆ to_degrees

constexpr float gramods::gmCore::angle::to_degrees = (float)(180.f / GM_PI)
staticconstexpr

Multiplier to convert from radians to degrees.

◆ value

float gramods::gmCore::angle::value

The angle in radians.


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