mhuss utils 1.1.5ws

com.mhuss.AstroLib
Class LocationElements

java.lang.Object
  extended by com.mhuss.AstroLib.LocationElements

public class LocationElements
extends java.lang.Object

This is a convenience class used for passing around polar coordinates.


Field Summary
static int LATITUDE
          Pseudo-enum indices into vector form of LocationElements.
static int LONGITUDE
          Pseudo-enum indices into vector form of LocationElements.
static int RADIUS
          Pseudo-enum indices into vector form of LocationElements.
static int X
           
static int Y
           
static int Z
           
 
Constructor Summary
LocationElements()
          Default constructor
LocationElements(double[] vector)
          Vector constructor
LocationElements(Latitude lat, Longitude lon, double rad)
          Explicit constructor
 
Method Summary
 double[] get()
          Get all values in this instance as a vector.
 double getLatitude()
          Get the latitude
 double getLongitude()
          Get the longitude
 double getRadius()
          Get the radius
 double getX()
          Get the X element
 double getY()
          Get the Y element
 double getZ()
          Get the Z element
 void invalidate()
          Mark all members as invalid
 void set(double[] vector)
          Set all members of this instance from a vector.
 void set(double lat, double lon, double rad)
          Set all members of this instance individually
 void setLatitude(double d)
          Set the latitude
 void setLongitude(double d)
          Set the longitude
 void setRadius(double d)
          Set the radius
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LATITUDE

public static final int LATITUDE
Pseudo-enum indices into vector form of LocationElements.

See Also:
Constant Field Values

LONGITUDE

public static final int LONGITUDE
Pseudo-enum indices into vector form of LocationElements.

See Also:
Constant Field Values

RADIUS

public static final int RADIUS
Pseudo-enum indices into vector form of LocationElements.

See Also:
Constant Field Values

X

public static final int X
See Also:
Constant Field Values

Y

public static final int Y
See Also:
Constant Field Values

Z

public static final int Z
See Also:
Constant Field Values
Constructor Detail

LocationElements

public LocationElements()
Default constructor


LocationElements

public LocationElements(Latitude lat,
                        Longitude lon,
                        double rad)
Explicit constructor

Parameters:
lat - latitude, X
lon - longitude, Y
rad - radius, Z

LocationElements

public LocationElements(double[] vector)
Vector constructor

Parameters:
vector - { lat, lon, rad }
Method Detail

invalidate

public void invalidate()
Mark all members as invalid


getLatitude

public double getLatitude()
Get the latitude

Returns:
The latitude value of this instance

getX

public double getX()
Get the X element

Returns:
The X value (in XYZ vector form) of this instance

getLongitude

public double getLongitude()
Get the longitude

Returns:
The longitude value of this instance

getY

public double getY()
Get the Y element

Returns:
The Y value (in XYZ vector form) of this instance

getRadius

public double getRadius()
Get the radius

Returns:
The radius value of this instance

getZ

public double getZ()
Get the Z element

Returns:
The Z value (in XYZ vector form) of this instance

get

public double[] get()
Get all values in this instance as a vector.

The vector is an array of three doubles, latitude, longitude, and radius, in that order.

Returns:
v[0] = latitude, v[1] = longitude, v[2] = radius

setLatitude

public void setLatitude(double d)
Set the latitude

Parameters:
d - The new latitude value

setLongitude

public void setLongitude(double d)
Set the longitude

Parameters:
d - The new longitude value

setRadius

public void setRadius(double d)
Set the radius

Parameters:
d - The new radius value

set

public void set(double[] vector)
Set all members of this instance from a vector.

The vector is an array of three doubles, latitude, longitude, and radius, in that order.

Parameters:
vector - v[0] = latitude, v[1] = longitude, v[2] = radius

set

public void set(double lat,
                double lon,
                double rad)
Set all members of this instance individually

Parameters:
lat - The new latitude
lon - The new longitude
rad - The new radius

mhuss utils 1.1.5ws

bottom text