org.onebusaway.geospatial.model
public class PointVector extends Object
Constructor and Description |
---|
PointVector(double... vector) |
Modifier and Type | Method and Description |
---|---|
<T extends Point> |
addToPoint(T origin) |
static <T extends Point> |
create(T origin,
T direction) |
double |
dotProduct(PointVector v) |
boolean |
equals(Object obj)
Object Interface |
double |
getAngle() |
double |
getAngle(PointVector v) |
PointVector |
getAsLength(double length)
Scale our vector such that it has the specified length
|
double |
getCosAngle(PointVector v) |
PointVector |
getCrossProduct(PointVector v) |
int |
getDimensions() |
double |
getOrdinate(int dimension) |
double[] |
getOrdinates() |
PointVector |
getProjection(PointVector v)
Project a vector v onto this vector
|
PointVector |
getScaled(double factor)
Operations
|
double |
getSinAngle(PointVector v) |
PointVector |
getUnitVector() |
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode() |
double |
length()
Properties
|
PointVector |
rotate(double angle) |
PointVector |
rotate(double angle,
int dimensionA,
int dimensionB) |
String |
toString() |
public static <T extends Point> PointVector create(T origin, T direction)
public int getDimensions()
public double getOrdinate(int dimension)
public double[] getOrdinates()
public double getX()
public double getY()
public double getZ()
public double length()
public double dotProduct(PointVector v)
public PointVector getCrossProduct(PointVector v)
public double getCosAngle(PointVector v)
public double getSinAngle(PointVector v)
public double getAngle(PointVector v)
v
- the other vectorpublic double getAngle()
public PointVector getScaled(double factor)
public PointVector getUnitVector()
public PointVector getProjection(PointVector v)
v
- the vector to projectpublic PointVector getAsLength(double length)
length
- - the target lengthpublic PointVector rotate(double angle)
public PointVector rotate(double angle, int dimensionA, int dimensionB)
public <T extends Point> T addToPoint(T origin)
T
- the position typeorigin
- point to translateCopyright © 2014 OneBusAway. All Rights Reserved.