taxisrus.implementation.scheduler_stuff
Class Vector2D

java.lang.Object
  |
  +--taxisrus.implementation.scheduler_stuff.Vector2D

public class Vector2D
extends Object

Two dimensional representation of a point.

Author:
SegFaults

Constructor Summary
Vector2D()
          Default constructor, sets the object to have coordinate 0,0
Vector2D(float x, float y)
          Constructor, sets the object to have coordinate x,y
 
Method Summary
 Vector2D Add(Vector2D vec)
          Two dimensional vector addition.
 Vector2D Divide(float scalar)
          Two dimensional vector division.
 float DotProduct(Vector2D vec)
          Calculates the mathematical dot product of two two dimensional vectors.
 boolean equals(Object obj)
          Overrides Object's equals function
 float GetCrossProduct(Vector2D vec)
           
 Vector2D GetNormal()
           
 float GetX()
          Gets the x component of the vector.
 float GetY()
          Gets the y component of the vector.
 float Length()
          Calculates the distance between two
 Vector2D Multiply(float scalar)
          Two dimensional vector multiplication.
 void Set(float x, float y)
          Sets the vector to have coordinate x,y.
 Vector2D Subtract(Vector2D vec)
          Two dimensional vector subtraction.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vector2D

public Vector2D()
Default constructor, sets the object to have coordinate 0,0

Vector2D

public Vector2D(float x,
                float y)
Constructor, sets the object to have coordinate x,y
Method Detail

GetX

public float GetX()
Gets the x component of the vector.

GetY

public float GetY()
Gets the y component of the vector.

Set

public void Set(float x,
                float y)
Sets the vector to have coordinate x,y.

DotProduct

public float DotProduct(Vector2D vec)
Calculates the mathematical dot product of two two dimensional vectors.

Length

public float Length()
Calculates the distance between two

GetNormal

public Vector2D GetNormal()

GetCrossProduct

public float GetCrossProduct(Vector2D vec)

Add

public Vector2D Add(Vector2D vec)
Two dimensional vector addition.

Subtract

public Vector2D Subtract(Vector2D vec)
Two dimensional vector subtraction.

Multiply

public Vector2D Multiply(float scalar)
Two dimensional vector multiplication.

Divide

public Vector2D Divide(float scalar)
Two dimensional vector division.

equals

public boolean equals(Object obj)
Overrides Object's equals function
Overrides:
equals in class Object


API documentation for build 958