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

Sunlit Design > The Sun API > Documentation > sdxAzi Function


Index


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

Contact Developer

Downloads

sdxAzi Function

Description

Returns the Azimuth (Compass Direction) in degrees for a given point in time.

Syntax

sdxAzi(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 Azimuth (Compass Direction) varies on a daily and annual cycle.  

Azimuth varies from 0 to 360 degrees.  North is 0, East 90, South 180 and West 270 degrees.

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 Azimuth 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 Azimuth by coordinate transformation from H, D, and latitude (like sdEqu2Azi 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 Azimuth at MJD 52448.125 (3am UT, June 23rd, 2002) at the Greenwich observatory:
    The Greenwich observatory is at 0 longitude and 51d29m North.
    
    sdxAzi("<MJD>52448.125</MJD>",0,sdDMS2D(sdDMSNorth(),51,29,0))
 
    
   
equals 40.2368 degrees (or just north of North East).  

What is the Solar Azimuth at 6am, 21st January, 2001 in Amsterdam?:
    Amsterdam's timezone is -1, longitude is 4d32m East, and latitude 52d22m North.
    
    sdxAzi(sdMJDx(2001,1,21,6,0,0,-1),
        sdDMS2D(sdDMSEast,4,32,0),sdDMS2D(sdDMSNorth,52,22,0))  
    
equals 92.2893 degrees. (or almost due east getting ready to rise quite south of east.)