public class Vector2D
extends java.lang.Object
Constructor and Description |
---|
Vector2D(double x,
double y)
Constructor a Vector with components x and y.
|
Vector2D(javax.vecmath.Point2d p)
Constructor: a copy of p.
|
Vector2D(Vector2D p)
Constructor: A copy of p.
|
Modifier and Type | Method and Description |
---|---|
Vector2D |
add(Vector2D a)
Return the result of adding this vector to a.
|
static Vector2D |
add(Vector2D a,
Vector2D b)
Return the result of adding a and b.
|
void |
addOn(Vector2D v)
Add v to this vector.
|
static double |
dist(Vector2D a,
Vector2D b)
Return the Euclidean distance between points a and b.
|
Vector2D |
minus(Vector2D b)
Return the result of subtracting b from this vector.
|
java.lang.String |
toString()
Return a representation (x, y) of this instance.
|
public Vector2D(Vector2D p)
public Vector2D(javax.vecmath.Point2d p)
public Vector2D(double x, double y)
public java.lang.String toString()
toString
in class java.lang.Object
public static double dist(Vector2D a, Vector2D b)
public void addOn(Vector2D v)