de.steeringbehaviors.simulation.renderer
Class Point2d

java.lang.Object
  extended by de.steeringbehaviors.simulation.renderer.Point2d

public class Point2d
extends java.lang.Object

class Point2d Implements a point in 2d space


Field Summary
protected  double m_x
          X position
protected  double m_y
          Y position
 
Constructor Summary
Point2d()
          Constructor
Point2d(double x, double y)
          Constructor
Point2d(Point2d v)
          Constructor
 
Method Summary
 Point2d add(Vector2d v)
          Adds a vector to this point and returns the resulting point
 double getX()
          Returns the current x position
 double getY()
          Returns the current y position
 void setX(double x)
          Sets the current x position
 void setY(double y)
          Sets the current y position
 Vector2d sub(Point2d p)
          Subtracts a vector from this point and returns the resulting point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_x

protected double m_x
X position


m_y

protected double m_y
Y position

Constructor Detail

Point2d

public Point2d()
Constructor


Point2d

public Point2d(double x,
               double y)
Constructor

Parameters:
x - X position
y - Y position

Point2d

public Point2d(Point2d v)
Constructor

Parameters:
v - Copyconstructor
Method Detail

setX

public void setX(double x)
Sets the current x position

Parameters:
x - New x position

setY

public void setY(double y)
Sets the current y position

Parameters:
y - New y position

getX

public double getX()
Returns the current x position

Returns:
Current x position

getY

public double getY()
Returns the current y position

Returns:
Current y position

add

public Point2d add(Vector2d v)
Adds a vector to this point and returns the resulting point

Parameters:
v - Vector
Returns:
Resulting point

sub

public Vector2d sub(Point2d p)
Subtracts a vector from this point and returns the resulting point

Parameters:
p - Vector
Returns:
Resulting point