com.mhuss.AstroLib
Class LocationElements
- java.lang.Object
-
- com.mhuss.AstroLib.LocationElements
-
public class LocationElements extends java.lang.ObjectThis is a convenience class used for passing around polar coordinates.
-
-
Field Summary
Fields Modifier and Type Field and Description static intLATITUDEPseudo-enum indices into vector form of LocationElements.static intLONGITUDEPseudo-enum indices into vector form of LocationElements.static intRADIUSPseudo-enum indices into vector form of LocationElements.static intXstatic intYstatic intZ
-
Constructor Summary
Constructors Constructor and Description LocationElements()Default constructorLocationElements(double[] vector)Vector constructorLocationElements(Latitude lat, Longitude lon, double rad)Explicit constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]get()Get all values in this instance as a vector.doublegetLatitude()Get the latitudedoublegetLongitude()Get the longitudedoublegetRadius()Get the radiusdoublegetX()Get the X elementdoublegetY()Get the Y elementdoublegetZ()Get the Z elementvoidinvalidate()Mark all members as invalidvoidset(double[] vector)Set all members of this instance from a vector.voidset(double lat, double lon, double rad)Set all members of this instance individuallyvoidsetLatitude(double d)Set the latitudevoidsetLongitude(double d)Set the longitudevoidsetRadius(double d)Set the radius
-
-
-
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, Xlon- longitude, Yrad- 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 latitudelon- The new longituderad- The new radius
-
-
DMelt 3.0 © DataMelt by jWork.ORG