Class Vector
java.lang.Object
Vector
public class Vector
- extends java.lang.Object
A simple, two-dimensional vector.
|
Field Summary |
protected double |
x
|
protected double |
y
|
|
Method Summary |
void |
add(Vector vectorToAdd)
Add a vector to this vector. |
double |
getX()
|
double |
getY()
|
double |
length()
Absolute value of the vector, a. |
void |
set(double xV,
double yV)
|
void |
setX(double xValue)
|
void |
setY(double yValue)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
x
protected double x
y
protected double y
Vector
public Vector(double xValue,
double yValue)
Vector
public Vector(int xV,
int yV)
Vector
public Vector(Vector v)
getX
public double getX()
setX
public void setX(double xValue)
getY
public double getY()
setY
public void setY(double yValue)
set
public void set(double xV,
double yV)
length
public double length()
- Absolute value of the vector, a. k. a. length of its arrows.
add
public void add(Vector vectorToAdd)
- Add a vector to this vector.