This site Web
Home Page | The Sun API | Gallery | InfoSearch | News | Links | Contact Us

Sunlit Design > The Sun API > Documentation > sdxDecl Function


- Introduction
+ Using the Functions
+ User Guide
+ Function Reference
+ Constants

Contact Developer


sdxDecl Function


Returns the Solar Declination in degrees for a given point in time.




A String; Modified Julian Day (MJD) or Solar Day of Year (SDY) time value.

Time Value Formats

MJD Time Value

"<MJD> nnn </MJD>"
"<MJD> nnn </MJD><TimeZone> tz </TimeZone>"

See sdMJDx function.
SDY Time Value

"<SDY> nnn </SDY>"
"<SDY> nnn </SDY><TimeZone> tz </TimeZone>"

See sdSDYx function.

All MJD and SDY values are expressed in UT. A <TimeZone> appended to the time value is informational only and doesn't affect the time value. 

The sdMJDx and sdSDYx functions may be used to create time values usable by this function.

Return Values

sdxDecl returns a double precision number. Solar Declination varies on an annual cycle.  The minimum value is approximately -23.5, the maximum +23.5 degrees.  A negative number indicates that the sun is South with respect to the equator.

If timex is a

MJD time value     The function returns a value for that point in world history.
SDY time value The function returns a "least error"/ "average value" optimised for the years 2000 to 2100.  How?


Solar Declination is calculated using algorithms published in Meeus, Jean. "Astronomical Algorithms" 2nd Ed., Willmann-Bell.

You can convert a degree value to it's Degrees:Minute:Seconds components using the sdDUnpackx function and to a printable text format using sdD2Text function.

It is not meaningful to convert a declination in degrees into a time unit using the sdD2Unit function.


What is the Solar Declination at MJD 52448.125 (3am UT, June 23rd, 2002) :
    sdxDecl("<MJD>52448.125</MJD>") equals 23.4310 degrees

What is the Solar Declination at 6am, 21st January, 2001 Amsterdam time?:
    Amsterdam's timezone is -1
    sdxDecl(sdMJDx(2001,1,21,6,0,0,-1))  equals -19.8869 degrees

What is the Solar Declination for the point on a projection sundial to show 6am, 21st January in Amsterdam?:
    Amsterdam's timezone is -1
    We will use the Solar Day of Year timescale as this is year independent.
    sdxDecl(sdSDYx(1,21,6,0,0,-1))  equals -19.8589 degrees