The Nebula Device 3: Math::polar Class Reference

The Nebula Device 3

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).

(C) 2004 RadonLabs GmbH

Public Member Functions

 polar ()
 the default constructor
 polar (scalar t, scalar r)
 constructor, theta and rho args
 polar (const vector &v)
 constructor, normalized cartesian vector as arg
 polar (const polar &src)
 the copy constructor
void operator= (const polar &rhs)
 the assignment operator
vector 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 vector &v)
 set to cartesian

Member Function Documentation

vector Math::polar::get_cartesian (  )  const [inline]

convert to normalized cartesian coords

Convert polar to cartesian.

void Math::polar::set ( const vector vec  )  [inline]

set to cartesian

Convert cartesian to polar.