|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.algorithm.Vector2D
public class Vector2D
A 2-dimensional vector represented by double-precision X and Y components.
Constructor Summary | |
---|---|
Vector2D()
|
|
Vector2D(Coordinate v)
|
|
Vector2D(Coordinate from,
Coordinate to)
|
|
Vector2D(double x,
double y)
|
|
Vector2D(Vector2D v)
|
Method Summary | |
---|---|
Vector2D |
add(Vector2D v)
|
double |
angle()
|
double |
angle(Vector2D v)
|
double |
angleTo(Vector2D v)
|
Vector2D |
average(Vector2D v)
|
static Vector2D |
create(Coordinate v)
|
static Vector2D |
create(Coordinate from,
Coordinate to)
|
static Vector2D |
create(double x,
double y)
|
static Vector2D |
create(Vector2D v)
|
Vector2D |
divide(double d)
|
double |
dot(Vector2D v)
Computes the dot-product of two vectors |
boolean |
equals(java.lang.Object o)
Tests if a vector o has the same values for the x and y components. |
double |
getComponent(int index)
|
double |
getX()
|
double |
getY()
|
int |
hashCode()
Gets a hashcode for this vector. |
double |
length()
|
double |
lengthSquared()
|
Vector2D |
multiply(double d)
|
Vector2D |
negate()
|
Vector2D |
normalize()
|
Vector2D |
rotate(double angle)
|
Vector2D |
rotateByQuarterCircle(int numQuarters)
Rotates a vector by a given number of quarter-circles (i.e. |
Vector2D |
subtract(Vector2D v)
|
Coordinate |
toCoordinate()
|
java.lang.String |
toString()
|
Coordinate |
translate(Coordinate coord)
|
Vector2D |
weightedSum(Vector2D v,
double frac)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vector2D()
public Vector2D(double x, double y)
public Vector2D(Vector2D v)
public Vector2D(Coordinate from, Coordinate to)
public Vector2D(Coordinate v)
Method Detail |
---|
public static Vector2D create(double x, double y)
public static Vector2D create(Vector2D v)
public static Vector2D create(Coordinate v)
public static Vector2D create(Coordinate from, Coordinate to)
public double getX()
public double getY()
public double getComponent(int index)
public Vector2D add(Vector2D v)
public Vector2D subtract(Vector2D v)
public Vector2D multiply(double d)
public Vector2D divide(double d)
public Vector2D negate()
public double length()
public double lengthSquared()
public Vector2D normalize()
public Vector2D average(Vector2D v)
public Vector2D weightedSum(Vector2D v, double frac)
public double dot(Vector2D v)
v1
- a vectorv2
- a vector
public double angle()
public double angle(Vector2D v)
public double angleTo(Vector2D v)
public Vector2D rotate(double angle)
public Vector2D rotateByQuarterCircle(int numQuarters)
v
- the vector to rotate.numQuarters
- the number of quarter-circles to rotate by
public Coordinate translate(Coordinate coord)
public Coordinate toCoordinate()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- a Vector2D with which to do the comparison.
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |