Nebula
|
#include <polar.h>
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 |
|
inline |
the default constructor
|
inline |
constructor, normalized cartesian vector as arg
|
inline |
the copy constructor
|
inline |
convert to normalized cartesian coords
Convert polar to cartesian.
|
inline |
the assignment operator
|
inline |
set to polar object
|
inline |
set to cartesian
Convert cartesian to polar.
scalar Math::polar::rho |
scalar Math::polar::theta |