roboplayer.geometry
Class Polar

java.lang.Object
  |
  +--roboplayer.geometry.Polar
Direct Known Subclasses:
ObjectInfo

public class Polar
extends java.lang.Object

Helper class for operations on polar coordinates.

Version:
1.0
Author:
Krzysztof Langner

Field Summary
 double dir
           
 double dist
           
 
Constructor Summary
Polar()
          Empty constructor
Polar(double r, double a)
          Constructor.
Polar(Polar p)
          Constructor.
 
Method Summary
 void addOld(Polar p)
          Add given polar to this one
 double getDistance(Polar pos)
          This function calculates distance between this and given second polar
 Vector2d getPosition()
          This function calculates position from polar coordinates
 java.lang.String toString()
          Convert to string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dist

public double dist

dir

public double dir
Constructor Detail

Polar

public Polar()
Empty constructor


Polar

public Polar(Polar p)
Constructor. Creates object at specified location

Parameters:
p - Polar to copy

Polar

public Polar(double r,
             double a)
Constructor. Creates object at specified location

Parameters:
r - distance
a - angle
Method Detail

getDistance

public double getDistance(Polar pos)
This function calculates distance between this and given second polar

Parameters:
pos - second object position
Returns:
distance

addOld

public void addOld(Polar p)
Add given polar to this one

Parameters:
p - polar to add ?????

getPosition

public Vector2d getPosition()
This function calculates position from polar coordinates

Returns:
x,y position

toString

public java.lang.String toString()
Convert to string

Overrides:
toString in class java.lang.Object
Returns:
object converted to string