|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.naokishibata.math.Vector2D
public class Vector2D
Vector2D is an immutable class representing a 2-dimensional vector.
Field Summary | |
---|---|
double |
x
The first coordinate. |
double |
y
The first coordinate. |
Constructor Summary | |
---|---|
Vector2D(double x0,
double y0)
Constructs a new Vector2D instance which represents (x0, y0) vector. |
Method Summary | |
---|---|
static Vector2D |
add(Vector2D v,
Vector2D u)
Returns the addition of vectors v and u. |
static Vector2D |
add(Vector2D v,
Vector2D u,
Vector2D w)
Returns the addition of vectors v, u and w. |
static Vector2D |
add(Vector2D v,
Vector2D u,
Vector2D w,
Vector2D x)
Returns the addition of vectors v, u, w and x. |
static double |
angle(Vector2D v,
Vector2D w)
Returns the angle between v and w. |
int |
compareTo(java.lang.Object o)
|
double |
cross(Vector2D v)
|
static double |
crossProduct(Vector2D v,
Vector2D u)
Returns the cross product of vectors v and u. |
static double |
distance(Vector2D v,
Vector2D w)
Returns the distance between v and w. |
static double |
distanceSquared(Vector2D v,
Vector2D w)
Returns the squared distance between v and w. |
Vector2D |
dot(double d)
|
double |
dot(Vector2D v)
Returns the cross product of this and v |
static double |
dotProduct(Vector2D v,
Vector2D u)
Returns the dot product of vectors v and u. |
boolean |
epsilonEquals(Vector2D v)
|
boolean |
epsilonEquals(Vector2D v,
double eps)
|
static boolean |
epsilonEquals(Vector2D v,
Vector2D u)
|
static boolean |
epsilonEquals(Vector2D v,
Vector2D u,
double eps)
|
boolean |
equals(java.lang.Object o)
|
boolean |
equals(Vector2D v)
|
static boolean |
equals(Vector2D v,
Vector2D u)
|
int |
hashCode()
|
double |
length()
Returns the length of this vector. |
static double |
length(Vector2D v)
Returns the length of v. |
static double |
lengthSquared(Vector2D v)
Returns the squared length of v. |
static Vector2D |
midpoint(Vector2D v,
Vector2D w)
Returns the midpoint between v and w. |
Vector2D |
minus(Vector2D v)
Returns this - v |
Vector2D |
normalize()
|
static Vector2D |
normalize(Vector2D v)
Returns the normalized vector of v. |
Vector2D |
normalized()
|
Vector2D |
orthogonal()
|
Vector2D |
plus(Vector2D v)
Returns this + v |
static Vector2D |
scale(double s,
Vector2D v)
Returns vector v scaled by s |
static Vector2D |
scale(Vector2D v,
double s)
Returns vector v scaled by s |
static Vector2D |
sub(Vector2D v,
Vector2D u)
Returns v - u. |
java.lang.String |
toString()
Returns the string representation of the vector. |
double |
x()
Returns the first coordinate. |
double |
y()
Returns the second coordinate. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final double x
public final double y
Constructor Detail |
---|
public Vector2D(double x0, double y0)
Method Detail |
---|
public double x()
public double y()
public java.lang.String toString()
toString
in class java.lang.Object
public static Vector2D add(Vector2D v, Vector2D u)
public static Vector2D add(Vector2D v, Vector2D u, Vector2D w)
public static Vector2D add(Vector2D v, Vector2D u, Vector2D w, Vector2D x)
public static Vector2D sub(Vector2D v, Vector2D u)
public static double dotProduct(Vector2D v, Vector2D u)
public static double crossProduct(Vector2D v, Vector2D u)
public static Vector2D scale(double s, Vector2D v)
public static Vector2D scale(Vector2D v, double s)
public static Vector2D normalize(Vector2D v)
public static double length(Vector2D v)
public static double lengthSquared(Vector2D v)
public static double distance(Vector2D v, Vector2D w)
public static double distanceSquared(Vector2D v, Vector2D w)
public static Vector2D midpoint(Vector2D v, Vector2D w)
public static double angle(Vector2D v, Vector2D w)
public static boolean epsilonEquals(Vector2D v, Vector2D u, double eps)
public static boolean epsilonEquals(Vector2D v, Vector2D u)
public static boolean equals(Vector2D v, Vector2D u)
public double length()
public Vector2D normalize()
public boolean epsilonEquals(Vector2D v, double eps)
public boolean epsilonEquals(Vector2D v)
public Vector2D plus(Vector2D v)
public Vector2D minus(Vector2D v)
public double dot(Vector2D v)
public Vector2D dot(double d)
public double cross(Vector2D v)
public Vector2D orthogonal()
public Vector2D normalized()
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(Vector2D v)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |