JavaGrinders.spatial
Class PolarVector

java.lang.Object
  extended by JavaGrinders.spatial.SpatialVector
      extended by JavaGrinders.spatial.PolarVector
All Implemented Interfaces:
java.lang.Cloneable

public class PolarVector
extends SpatialVector

characterizes a spherical vector with degrees for longitude and latitude, and vector length


Constructor Summary
PolarVector()
          constructor that creates a zero vector.
PolarVector(double longDeg, double latDeg, double vecLength)
          constructor specifying initial degrees for longitude and latitude, and vector length.
 
Method Summary
 void copy(PolarVector v)
          copy other vector into this one
 double getLat()
          retrieves the latitude component in radians
 double getLatDeg()
          retrieves the latitude component in degrees
 double getLength()
          retrieves the length of the vector
 double getLong()
          retrieves the longitude component in radians
 double getLongDeg()
          retrieves the longitude component in degrees
 void setLat(double newLat)
          sets the latitude component in radians
 void setLatDeg(double newLatDeg)
          sets the latitude component in degrees
 void setLong(double newLong)
          sets the longitude component in radians
 void setLongDeg(double newLongDeg)
          sets the longitude component in degrees
 SpatialVector toSpatialVector()
          returns the vector as polar coordinates
 java.lang.String toString()
          Returns a string representation of the vector.
 void updateXYZ()
          returns the vector as polar coordinates
 
Methods inherited from class JavaGrinders.spatial.SpatialVector
applyVector, applyVector, clone, copy, cross, dot, equals, getConnect, getEuclidianDistance, getLengthSquared, getManhattanDistance, getManhattanLength, getPolarVector, getScaledPoint, getSpatialVector, getSquaredEuclidianDistance, getX, getXY, getY, getZ, minus, negate, negateX, negateY, negateZ, plus, remapLatLongToDistanceCoords, rotate, rotate, rotateXY, rotateXZ, scale, setConnect, setLength, setX, setY, setZ, subtract, times, toPoint, toPolarVector, unitLength
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolarVector

public PolarVector(double longDeg,
                   double latDeg,
                   double vecLength)
constructor specifying initial degrees for longitude and latitude, and vector length. Longitude for the western hemisphere and latitude for the southern hemisphere are expressed as negative values

Parameters:
longDeg - longitude degrees
latDeg - latitude degrees
vecLength - the length of the vector

PolarVector

public PolarVector()
constructor that creates a zero vector.

Method Detail

copy

public void copy(PolarVector v)
copy other vector into this one

Parameters:
v - a 3d vector

getLongDeg

public final double getLongDeg()
retrieves the longitude component in degrees

Overrides:
getLongDeg in class SpatialVector
Returns:
longitude in degrees

getLong

public final double getLong()
retrieves the longitude component in radians

Overrides:
getLong in class SpatialVector
Returns:
longitude in radians

getLatDeg

public final double getLatDeg()
retrieves the latitude component in degrees

Overrides:
getLatDeg in class SpatialVector
Returns:
latitude in degrees

getLat

public final double getLat()
retrieves the latitude component in radians

Overrides:
getLat in class SpatialVector
Returns:
latitude in radians

getLength

public final double getLength()
retrieves the length of the vector

Overrides:
getLength in class SpatialVector
Returns:
the magnitude of the vector

setLongDeg

public void setLongDeg(double newLongDeg)
sets the longitude component in degrees

Parameters:
newLongDeg - longitude degrees

setLong

public void setLong(double newLong)
sets the longitude component in radians

Parameters:
newLong - longitude degrees in radians

setLatDeg

public void setLatDeg(double newLatDeg)
sets the latitude component in degrees

Parameters:
newLatDeg - latitude degrees

setLat

public void setLat(double newLat)
sets the latitude component in radians

Parameters:
newLat - latitude degrees in radians

updateXYZ

public void updateXYZ()
returns the vector as polar coordinates


toSpatialVector

public SpatialVector toSpatialVector()
returns the vector as polar coordinates

Overrides:
toSpatialVector in class SpatialVector

toString

public java.lang.String toString()
Returns a string representation of the vector. Overrides the toString method in the base Object class.

Overrides:
toString in class SpatialVector
Returns:
a string representation of the vector