|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJavaGrinders.spatial.SpatialVector
public class SpatialVector
provides the interface for obtaining descriptive statistics from continuous variables.
| Constructor Summary | |
|---|---|
SpatialVector()
empty constructor |
|
SpatialVector(double x,
double y)
Standard constructor for the 2D SpatialVector class with x and y coordinates provided |
|
SpatialVector(double x,
double y,
double z)
constructor specifying initial x, y, and z coordinates |
|
SpatialVector(java.awt.geom.Point2D.Double aPoint)
Standard constructor for the 2D SpatialVector class with x and y coordinates provided |
|
| Method Summary | |
|---|---|
SpatialVector |
applyVector(PolarVector aVector)
Returns the coordinates of the Location after a Move has been applied to it |
SpatialVector |
applyVector(SpatialVector aVector)
Returns the coordinates of the Location after a Move has been applied to it |
java.lang.Object |
clone()
clone the object |
void |
copy(SpatialVector v)
copy other vector into this one |
SpatialVector |
cross(SpatialVector v)
Calculates the cross product of this vector and the one passed to it. |
double |
dot(SpatialVector v)
Calculates the dot product of this vector and another |
boolean |
equals(SpatialVector v)
Tests whether or not two vectors are identical in respect to x,y,z coordinates. |
boolean |
getConnect()
sets whether the move should be visually connected |
double |
getEuclidianDistance(SpatialVector theOtherLocation)
Returns the straight-line distance between two points |
double |
getLat()
Return the latitudinal heading in radians. |
double |
getLatDeg()
Return the latitudinal heading in degrees. |
double |
getLength()
Reports the magnitude of this vector |
double |
getLengthSquared()
Reports the magnitude of this vector squared |
double |
getLong()
Return the longitudinal heading in radians. |
double |
getLongDeg()
Return the longitudinal heading in degrees. |
double |
getManhattanDistance(SpatialVector theOtherLocation)
Returns the straight-line distance between two points |
double |
getManhattanLength()
Reports the magnitude of this vector |
PolarVector |
getPolarVector(SpatialVector theOtherLocation)
Returns the angle in degrees to another point. |
java.awt.Point |
getScaledPoint(GridSpace3D visualSpace)
Scales a single location to a frame's x and y scale values |
SpatialVector |
getSpatialVector(SpatialVector theOtherLocation)
Returns the angle in degrees to another point. |
double |
getSquaredEuclidianDistance(SpatialVector theOtherLocation)
Returns the straight-line distance between two points |
double |
getX()
retrieves the x component |
java.awt.geom.Point2D.Double |
getXY()
Scales a single location to a frame's x and y scale values |
double |
getY()
retrieves the y component |
double |
getZ()
retrieves the z component |
SpatialVector |
minus(SpatialVector v)
Subtracts a vector from this one and returns the result. |
void |
negate()
negate the SpatialVector |
void |
negateX()
negate the x axis of the SpatialVector |
void |
negateY()
negate the y axis of the SpatialVector |
void |
negateZ()
negate the z axis of the SpatialVector |
SpatialVector |
plus(SpatialVector v)
Adds another vector to this vector. |
void |
remapLatLongToDistanceCoords(SpatialVector theOrigin)
returns a latitude/longitude Capture remapped into a real distance |
SpatialVector |
rotate(double xyAngle,
double xzAngle)
Rotate vector in XYZ |
SpatialVector |
rotate(SpatialVector aVector)
Rotate vector in XYZ |
SpatialVector |
rotateXY(double r)
Rotate vector in XY |
SpatialVector |
rotateXZ(double r)
Rotate vector in XY |
SpatialVector |
scale(double dScalar)
Multiplies this vector by a scalar and keeps the result. |
void |
setConnect(boolean con)
Returns whether the move should be visually connected |
SpatialVector |
setLength(double newLength)
Scales the vector to a particular length |
double |
setX(double dNewX)
sets x component |
double |
setY(double dNewY)
sets y component |
double |
setZ(double dNewZ)
sets z component |
void |
subtract(SpatialVector v)
Subtracts argument vector from this vector. |
SpatialVector |
times(double dScalar)
Multiplies this vector by a scalar and returns the result. |
java.awt.Point |
toPoint()
returns the vector as a point |
PolarVector |
toPolarVector()
returns the vector as vector defined by measures of longitude, latitude, length |
SpatialVector |
toSpatialVector()
returns the vector as vector defined by measures of longitude, latitude, length |
java.lang.String |
toString()
Returns a string representation of the vector. |
void |
unitLength()
Normalizes vector to unit length |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SpatialVector(double x,
double y,
double z)
x - x coordinatey - y coordinatez - z coordinate
public SpatialVector(double x,
double y)
x - the x coordinate of the locationy - the y coordinate of the locationpublic SpatialVector(java.awt.geom.Point2D.Double aPoint)
aPoint - the coordinates as a Pointpublic SpatialVector()
| Method Detail |
|---|
public void setConnect(boolean con)
con - should the SpatialVector be connected with the previous vector?public boolean getConnect()
public void copy(SpatialVector v)
v - a SpatialVectorpublic SpatialVector plus(SpatialVector v)
v - a SpatialVectorpublic double dot(SpatialVector v)
v - a SpatialVector to dot with
public SpatialVector cross(SpatialVector v)
v - a SpatialVector to cross with
public double getX()
public double getY()
public double getZ()
public double setX(double dNewX)
dNewX - the nex x extentpublic double setY(double dNewY)
dNewY - the nex y extentpublic double setZ(double dNewZ)
dNewZ - the nex z extentpublic double getLat()
public double getLatDeg()
public double getLong()
public double getLongDeg()
public SpatialVector minus(SpatialVector v)
v - a SpatialVector
public SpatialVector times(double dScalar)
dScalar - a scalar (double) to multiply with
public SpatialVector scale(double dScalar)
dScalar - a scalar to multiply
public SpatialVector setLength(double newLength)
newLength - the desired length or the vector
public SpatialVector rotate(SpatialVector aVector)
aVector - the SpatialVector around which to rotate
public SpatialVector rotateXY(double r)
r - the angle (in radians) to rotate in the xy plane
public SpatialVector rotateXZ(double r)
r - the angle to rotate in the xz plane
public SpatialVector rotate(double xyAngle,
double xzAngle)
xyAngle - the angle to rotate in the xy planexzAngle - the angle to rotate in the xz plane
public void negate()
public void negateX()
public void negateY()
public void negateZ()
public void unitLength()
public double getLength()
public double getLengthSquared()
public double getManhattanLength()
public boolean equals(SpatialVector v)
v - another SpatialVector
public void subtract(SpatialVector v)
v - a SpatialVectorpublic java.awt.geom.Point2D.Double getXY()
public java.awt.Point getScaledPoint(GridSpace3D visualSpace)
visualSpace - the visual space in which x,y will be scaledpublic PolarVector toPolarVector()
public SpatialVector toSpatialVector()
public double getEuclidianDistance(SpatialVector theOtherLocation)
theOtherLocation - the other locationpublic double getSquaredEuclidianDistance(SpatialVector theOtherLocation)
theOtherLocation - the other locationpublic double getManhattanDistance(SpatialVector theOtherLocation)
theOtherLocation - the other locationpublic void remapLatLongToDistanceCoords(SpatialVector theOrigin)
public SpatialVector getSpatialVector(SpatialVector theOtherLocation)
theOtherLocation - the other locationpublic PolarVector getPolarVector(SpatialVector theOtherLocation)
theOtherLocation - the other locationpublic SpatialVector applyVector(SpatialVector aVector)
aVector - the vector to applypublic SpatialVector applyVector(PolarVector aVector)
aVector - the vector to applypublic java.lang.String toString()
toString in class java.lang.Objectpublic java.awt.Point toPoint()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||