orbotix.robot.util
Class Vector2D

java.lang.Object
  extended by orbotix.robot.util.Vector2D

public class Vector2D
extends java.lang.Object

Class to contain 2D vector coordinates.


Field Summary
 double x
          x coordinate.
 double y
          y coordinate
 
Constructor Summary
Vector2D(double x, double y)
          Constructor for a 2D vector.
 
Method Summary
 double magnitude()
          Magnitude for the vector.
static double magnitude(double x, double y)
          Convenience method to calculate the magnitude of two values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x
x coordinate.


y

public double y
y coordinate

Constructor Detail

Vector2D

public Vector2D(double x,
                double y)
Constructor for a 2D vector.

Parameters:
x - Coordinate.
y - Coordinate.
Method Detail

magnitude

public static double magnitude(double x,
                               double y)
Convenience method to calculate the magnitude of two values.

Parameters:
x - Coordinate.
y - Coordinate
Returns:
The magnitude of the vector values.

magnitude

public double magnitude()
Magnitude for the vector.

Returns:
The magnitude of the vector.