Nebula
Loading...
Searching...
No Matches
Math::polar Class Reference

#include <polar.h>

Detailed Description

A polar coordinate inline class, consisting of 2 angles theta (latitude) and rho (longitude).

Also offers conversion between cartesian and polar space.

Allowed range for theta is 0..180 degree (in rad!) and for rho 0..360 degree (in rad).

Public Member Functions

 polar ()
 the default constructor
 
 polar (scalar t, scalar r)
 constructor, theta and rho args
 
 polar (const vec3 &v)
 constructor, normalized cartesian vector as arg
 
 polar (const polar &src)
 the copy constructor
 
void operator= (const polar &rhs)
 the assignment operator
 
vec3 get_cartesian () const
 convert to normalized cartesian coords
 
void set (const polar &p)
 set to polar object
 
void set (scalar t, scalar r)
 set to theta and rho
 
void set (const vec3 &v)
 set to cartesian
 

Public Attributes

scalar theta
 
scalar rho
 

Constructor & Destructor Documentation

◆ polar() [1/4]

Math::polar::polar ( )
inline

the default constructor

◆ polar() [2/4]

Math::polar::polar ( scalar t,
scalar r )
inline

constructor, theta and rho args

◆ polar() [3/4]

Math::polar::polar ( const vec3 & v)
inline

constructor, normalized cartesian vector as arg

◆ polar() [4/4]

Math::polar::polar ( const polar & src)
inline

the copy constructor

Member Function Documentation

◆ get_cartesian()

vec3 Math::polar::get_cartesian ( ) const
inline

convert to normalized cartesian coords

Convert polar to cartesian.

◆ operator=()

void Math::polar::operator= ( const polar & rhs)
inline

the assignment operator

◆ set() [1/3]

void Math::polar::set ( const polar & p)
inline

set to polar object

◆ set() [2/3]

void Math::polar::set ( const vec3 & v)
inline

set to cartesian

Convert cartesian to polar.

◆ set() [3/3]

void Math::polar::set ( scalar t,
scalar r )
inline

set to theta and rho

Member Data Documentation

◆ rho

scalar Math::polar::rho

◆ theta

scalar Math::polar::theta

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