public class SimpleSol extends Object implements SolarPosition
SolarPosition. It uses a very simple algorithm
to calculate the Sun's celestial position.sunpos| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleSol.Test
Test purpose.
|
SolarPosition.Plato1, SolarPosition.Plato2| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
SimpleSol()
Constructs an invalid solar position instance.
|
SimpleSol(Date time)
Constructs a solar position instance with a specified date.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
public SimpleSol()
setDate(java.util.Date) before
calling any of the position retrieving methods, or an
IllegalStateException will be thrown.public SimpleSol(Date time)
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()