|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
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(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(java.lang.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 other)
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. |
Vector |
getDivided(double factor)
Creates a new Vector which represents this Vector divided by the provided scalar factor. |
double |
getDotProduct(Vector other)
Calculates the dot product of this Vector with another. |
double |
getLength()
Returns the length of this Vector. |
Vector |
getMultiplied(double factor)
Creates a new Vector which represents this Vector multiplied by the provided scalar factor. |
Vector |
getOrthogonalComplement()
Returns the orthogonal complement of this Vector, which is defined to be (-y, x). |
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 |
isHorizontal()
Checks whether this vector has a horizontal component. |
boolean |
isNull()
Checks whether this vector equals (0,0); |
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. |
boolean |
isVertical()
Checks whether this vector has a vertical component. |
PrecisionPoint |
toPoint()
Returns a point representation of this Vector. |
java.lang.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(double x, double y)
x
- X value.y
- Y value.public Vector(PrecisionPoint p)
p
- the pointpublic Vector(PrecisionPoint start, PrecisionPoint end)
start
- starting pointend
- End Pointpublic Vector(Vector start, Vector end)
start
- The start Rayend
- The end RayMethod Detail |
---|
public double getDissimilarity(Vector other)
other
- Vector being compared
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 other)
other
- Vector to calculate the average.
public Vector getMultiplied(double factor)
factor
- Value providing the amount to scale.
public Vector getDivided(double factor)
factor
- 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 boolean isHorizontal()
public boolean isVertical()
public boolean isNull()
public PrecisionPoint toPoint()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |