|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectastro.SimpleSol
public class SimpleSol
A class implementing SolarPosition. It uses a very simple algorithm
to calculate the Sun's celestial position.
sunpos| Nested Class Summary | |
|---|---|
static class |
SimpleSol.Test
Test purpose. |
| Nested classes/interfaces inherited from interface astro.SolarPosition |
|---|
SolarPosition.Plato |
| Field Summary | |
|---|---|
private static double |
ASUN
The constant coefficient. |
private static double |
BSUN
The linear coefficient. |
private Date |
Clock
The date used for the calculations. |
private static double |
CSUN
The quadratic coefficient. |
private double |
Dec
Declination of Sun, radians. |
private static double |
LAM
Constant for excentricity offset. |
private double |
Lambda
Ecliptical longitude of the Sun, radians. |
private static double |
NYA
Constant coefficient for calculating mean anamoly. |
private static double |
NYB
Linear coefficient for calculating mean anamoly. |
private static double |
NYC
Quadratic coefficient for calculating mean anamoly. |
private double |
Ra
Right ascension of the Sun, radians. |
private boolean |
RaDecValid
A boolean marking the availability of ra and declination. |
| Constructor Summary | |
|---|---|
SimpleSol()
Constructs an invalid solar position instance. |
|
SimpleSol(Date time)
Constructs a solar position instance with a specified date. |
|
| Method Summary | |
|---|---|
protected void |
calcLambda()
Calculates the ecliptical longitude of the Sun and transfers it into Lambda. |
protected void |
calcRaDec()
Calculates the right ascension and the declination of an object with the given ecliptical longitude and a latitude of zero. |
double |
getDec()
Returns the declination of the Sun. |
double |
getEclipticalLongitude()
Returns the ecliptical longitude of the Sun. |
double |
getRa()
Returns the right ascension of the Sun. |
void |
setDate(Date time)
Sets the date for which the Sun's position should be evaluated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final double ASUN
private static final double BSUN
private static final double CSUN
private static final double LAM
private static final double NYA
private static final double NYB
private static final double NYC
private double Lambda
private boolean RaDecValid
private double Ra
private double Dec
private Date Clock
| Constructor Detail |
|---|
public SimpleSol()
setDate(java.util.Date) before
calling any of the position retrieving methods, or an
IllegalStateException will be thrown.
public SimpleSol(Date time)
| Method Detail |
|---|
public void setDate(Date time)
setDate in interface SolarPositiontime - The date used for calculating the Sun's position.protected void calcLambda()
setDate(java.util.Date), therefore a valid date always
means a valid lambda.This method is quadratic in time.
public double getEclipticalLongitude()
IllegalStateException.
getEclipticalLongitude in interface SolarPositionpublic double getRa()
If this method is called
without a prior call to setDate, this method throws an
IllegalStateException.
getRa in interface SolarPositionpublic double getDec()
If this method is called
without a prior call to setDate, this method throws an
IllegalStateException.
getDec in interface SolarPositionprotected void calcRaDec()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||