|
Eclipse Draw2d 3.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.draw2d.geometry.Vector
public class Vector
Represents a vector within 2-dimensional Euclidean space.
| Field Summary | |
|---|---|
double |
x
the X value |
double |
y
the Y value |
| Constructor Summary | |
|---|---|
Vector()
Constructs a Vector with no direction and magnitude. |
|
Vector(double x,
double y)
Constructs a Vector pointed in the specified direction. |
|
Vector(PrecisionPoint p)
Constructs a Vector pointed in the direction specified by a Point. |
|
Vector(PrecisionPoint start,
PrecisionPoint end)
Constructs a Vector representing the direction and magnitude between to provided Points. |
|
Vector(Vector start,
Vector end)
Constructs a Vector representing the difference between two provided Vectors. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Vector |
getAdded(Vector other)
Creates a new Vector which is the sum of this Vector with another. |
double |
getAngle(Vector other)
Returns the angle (in degrees) between this Vector and the provided Vector. |
Vector |
getAveraged(Vector vector)
Creates a new Vector which represents the average of this Vector with another. |
double |
getCrossProduct(Vector other)
Calculates the cross product of this Vector with another. |
double |
getDissimilarity(Vector other)
Calculates the magnitude of the cross product of this Vector with another. |
double |
getDotProduct(Vector other)
Calculates the dot product of this Vector with another. |
double |
getLength()
Returns the length of this Vector. |
Vector |
getOrthogonalComplement()
Returns the orthogonal complement of this Vector, which is defined to be (-y, x). |
Vector |
getScaled(double scale)
Creates a new Vector which represents this Vector scaled by the amount provided. |
double |
getSimilarity(Vector other)
Calculates the similarity of this Vector with another. |
Vector |
getSubtracted(Vector other)
Creates a new Vector which is the difference of this Vector with the provided Vector. |
int |
hashCode()
|
boolean |
isOrthogonalTo(Vector other)
Calculates whether this Vector and the provided one are orthogonal to each other. |
boolean |
isParallelTo(Vector other)
Calculates whether this Vector and the provided one are parallel to each other. |
PrecisionPoint |
toPoint()
Returns a point representation of this Vector. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double x
public double y
| Constructor Detail |
|---|
public Vector()
public Vector(double x,
double y)
x - X value.y - Y value.public Vector(PrecisionPoint p)
p - the point
public Vector(PrecisionPoint start,
PrecisionPoint end)
start - starting pointend - End Point
public Vector(Vector start,
Vector end)
start - The start Rayend - The end Ray| Method Detail |
|---|
public double getDissimilarity(Vector other)
other - Vector being compared
getSimilarity(Vector)public boolean isParallelTo(Vector other)
other - The Vector to test for parallelism
public double getDotProduct(Vector other)
other - the Vector used to calculate the dot product
public double getCrossProduct(Vector other)
other - the Vector used to calculate the cross product
public Vector getAdded(Vector other)
other - Vector to be added to this Vector
public Vector getSubtracted(Vector other)
other - Vector to be subtracted from this Vector
public double getAngle(Vector other)
other - Vector to calculate the angle.
public Vector getAveraged(Vector vector)
vector - Vector to calculate the average.
public Vector getScaled(double scale)
scale - Value providing the amount to scale.
public Vector getOrthogonalComplement()
public double getLength()
public double getSimilarity(Vector other)
other - Vector being tested for similarity
getDissimilarity(Vector)public boolean isOrthogonalTo(Vector other)
other - Vector being tested for orthogonality
public PrecisionPoint toPoint()
public String toString()
toString in class ObjectObject.toString()public boolean equals(Object obj)
equals in class ObjectObject.equals(Object)public int hashCode()
hashCode in class ObjectObject.hashCode()
|
Eclipse Draw2d 3.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||