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

Sunlit Design > The Sun API > Documentation > sdEqu2Azi Function


Index


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

Contact Developer

Downloads

sdEqu2Azi Function

Purpose

Converts from Solar Equatorial Coordinates to Horizontal Coordinates.

Description

Returns Solar Azimuth (Compass Direction) in degrees.  

Syntax

sdEqu2Alt(h, latitude, decl)

h   

Solar Hour Angle. Between -180 and 180 degrees.  Negative angles are morning times.  Positive angles are afternoon times.
latitude Latitude of the observation point.  Between -90 and 90 degrees. Southern latitudes are negative.

decl  

Solar Declination. Between -25 and 25 degrees.  Declination is negative when the sun is south relative to the equator.

Return Values

sdEqu2Azi returns a double precision number from 0 to 360.  0 means North, 90 East, 180 South and 270 means West.

Errors

If the function detects an error in any of it's input parameters then it returns: -99999999

Remarks

This function calculates it's return value from the following coordinate transformation formula:

Azi=ArcTan(Sin(H)/(Sin(latitude)*Cos(H)-Tan(decl)*Cos(latitude)))

When the sun is directly in the centre of the sky, Azimuth is undefined.  When the sun is directly overhead: for latitudes in the Northern hemisphere this program returns 180 (i.e. South) and in the Southern hemisphere it returns 0 (i.e. North).

sdEqu2Azi is complimented by the sdEqu2Alt function which calculates Solar Azimuth.

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 in Sydney Australia when the Solar Hour is 11am and when the sun is at declination 23 degrees (sometime in June):
    Solar 11am gives hour angle of -15 degrees.
    Sydney Australia is at a latitude of 33degrees 53minutes South

    sdEqu2Azi(-15,sdDMS2D(sdDMSSouth,33,53,0),23) equals 16.20 degrees.