mako5.math
Class Polar

java.lang.Object
  extended by mako5.math.Polar
All Implemented Interfaces:
Cloneable

public final class Polar
extends Object
implements Cloneable

Represents a set of polar coordinates. Can be used to represent velocity and other things as well.

Version:
1-Feb 2006, 1-Jul 2006, 01-Aug 2006
Author:
Paul Jarrett

Constructor Summary
Polar()
          Another polar constructor.
Polar(float fRadius_, float fTheta_)
          Creates a new polar set
 
Method Summary
 void addRadius(float v)
          Adds to the radius of this polar value.
 void addTheta(float f)
          Adds to the theta value.
 Object clone()
          Clones this polar value.
 float getRadius()
          Returns the radius
 Angle getTheta()
          Returns the angle of this
 float getX()
          Returns the x-coordinate value of this.
 float getY()
          Returns the y-coordinate of this.
 void setRadius(float f)
          Sets the radius of the polar value.
 void setTheta(float f)
          Sets the theta value.
 R2v toVector()
          Converts this to a vector
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Polar

public Polar(float fRadius_,
             float fTheta_)
Creates a new polar set


Polar

public Polar()
Another polar constructor. Makes a polar value of (1.0f,0.0f).

Method Detail

clone

public Object clone()
Clones this polar value.

Overrides:
clone in class Object

getRadius

public float getRadius()
Returns the radius

Since:
01-Aug 2006

getTheta

public Angle getTheta()
Returns the angle of this

Since:
01-Aug 2006

setRadius

public void setRadius(float f)
Sets the radius of the polar value.

Since:
01-Aug 2006

setTheta

public void setTheta(float f)
Sets the theta value.

Parameters:
f - the new theta value in radians
Since:
05-Jul 2006

addTheta

public void addTheta(float f)
Adds to the theta value.

Parameters:
f - the amount to add in radians
Since:
01-Aug 2006

addRadius

public void addRadius(float v)
Adds to the radius of this polar value.

Parameters:
v - the amount to add
Since:
01-Aug 2006

getX

public float getX()
Returns the x-coordinate value of this.


getY

public float getY()
Returns the y-coordinate of this.


toVector

public R2v toVector()
Converts this to a vector