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

Sunlit Design > The Sun API > Documentation > sdxAlt Function


Index


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

Contact Developer

Downloads

sdxAlt Function

Description

Returns the Solar Altitude (Elevation from Horizon) in degrees for a given point in time.

Syntax

sdxAlt(timex, longitude, latitude)

timex   

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

longitude A numeric longitude value in degrees from -180 (west of Greenwich) to +180 (East of Greenwich)
latitude A numeric latitude value in degrees from -90 (south of equator) to +90 (north of equator)

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

This function returns a double precision number. The Solar Altitude (Elevation from Horizon) varies on a daily and annual cycle.  

Altitude varies from -90 to +90 degrees. A positive Altitude means that the sun is above the observer's horizon.

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?

Remarks

Solar Altitude is calculated by:
    Calculating the Hour Angle (H) from timex, and longitude (like sdxH does) then calculating Declination  (D) from timex (like sdxDecl does) followed by calculating the Altitude by coordinate transformation from H, D, and latitude (like sdEqu2Alt does).

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.

Example

What is the Solar Altitude at MJD 52448.125 (3am UT, June 23rd, 2002) at the Greenwich observatory:
    The Greenwich observatory is at 0 longitude and 51d29m North.
    
    sdxAlt("<MJD>52448.125</MJD>",0,sdDMS2D(sdDMSNorth(),51,29,0))
 
    
   
equals -5.5392 (or -5:32:21.2632) degrees.  I.E. The sun is just below the horizon and Morning civil twilight has just started. .

What is the Solar Altitude at 6am, 21st January, 2001 in Amsterdam?:
    Amsterdam's timezone is -1, longitude is 4d32m East, and latitude 52d22m North.
    
    sdxAlt(sdMJDx(2001,1,21,6,0,0,-1),
        sdDMS2D(sdDMSEast,4,32,0),sdDMS2D(sdDMSNorth,52,22,0))  
    
equals -23.6612 degrees. I.E. The sun is still quite a way below the horizon.