modm API documentation
modm::Angle Class Reference

Collection of functions for handling of angles. More...

#include <modm/math/geometry/angle.hpp>

Public Typedefs

typedef float Type
 

Static Public Member Functions

static float normalize (float angle)
 Normalize angle. More...
 
static float reverse (float angle)
 Reverse the angle. More...
 
static float perpendicular (float angle, const bool cw)
 Find a perpendicular angle. More...
 
static constexpr float toRadian (float angle)
 
static constexpr float toDegree (float angle)
 

Detailed Description

Collection of functions for handling of angles.

Angles are always represented by float values in the range from -Pi to Pi.

Member Function Documentation

float modm::Angle::normalize ( float  angle)
static

Normalize angle.

Normalize the given angle to [-Pi,Pi] by repeatedly adding/subtracting 2*Pi.

float modm::Angle::perpendicular ( float  angle,
const bool  cw 
)
static

Find a perpendicular angle.

Parameters
angle
cwIf cw is true the angle is rotated clockwise. Ohterwise the angle is rotated anti clockwise.
float modm::Angle::reverse ( float  angle)
static

Reverse the angle.

Reverse the angle and keep it normalized to [-Pi,Pi].

Equivalent to:

float angle = modm::Angle::normalize(angle + M_PI);

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