|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectastro.MoonPosition
public class MoonPosition
A class calculating the position of the moon. It is based on the AstroLib package provided by Mark Huss. He gives no hint about the precision of the formulas used, but from a first test I estimate an accuracy of down to one arc minute.
| Nested Class Summary | |
|---|---|
static class |
MoonPosition.Test
Testing purpose mainly. |
| Field Summary | |
|---|---|
private double |
dec
The declination of the moon. |
private com.mhuss.AstroLib.Lunar |
moon
The helper object calculating the moon position. |
private double |
ra
The right ascension of the moon. |
private boolean |
radecvalid
True if ra,dec are valid. |
private Date |
when
The date for which the moon position is valid. |
| Constructor Summary | |
|---|---|
MoonPosition()
Constructs a new moon position object. |
|
MoonPosition(Date fordate)
Constructs a new moon position object for the given date. |
|
| Method Summary | |
|---|---|
private void |
calcRaDec()
Calculates the right ascension and the declination of the moon. |
double |
getDec()
Returns the declination of the moon for the center of the earth in radians. |
double |
getDistance()
Returns the distance to the moon in kilometers. |
double |
getIlluminatedFraction()
|
double |
getLatitude()
Returns the ecliptical latitude of the moon for the center of the earth in radians. |
double |
getLongitude()
Returns the ecliptical longitude of the moon for the center of the earth in radians. |
double |
getRa()
Returns the right ascension of the moon for the center of the earth in radians. |
void |
setDate(Date fordate)
Sets a (new) date for the moon position object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Date when
private com.mhuss.AstroLib.Lunar moon
private double ra
private double dec
private boolean radecvalid
| Constructor Detail |
|---|
public MoonPosition()
public MoonPosition(Date fordate)
| Method Detail |
|---|
public void setDate(Date fordate)
public double getLongitude()
IllegalArgumentException - If no date was set.public double getLatitude()
IllegalArgumentException - If no date was set.public double getRa()
IllegalArgumentException - If no date was set.public double getDec()
IllegalArgumentException - If no date was set.public double getDistance()
IllegalArgumentException - If no date was set.public double getIlluminatedFraction()
private void calcRaDec()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||