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

Sunlit Design > The Sun API > Documentation > sdEqu2Alt Function


Index


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

Contact Developer

Downloads

sdEqu2Alt Function

Purpose

Converts from Solar Equatorial Coordinates to Horizontal Coordinates.

Description

Returns Solar Altitude (above horizon) 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

sdEqu2Alt returns a double precision number in the range -90 to 90. A positive value indicates that the sun is above the horizon. 

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:

Alt=ArcSin(Sin(latitude)*Sin(decl)+Cos(latitude)*Cos(decl)*Cos(H))

sdEqu2Alt is complimented by the sdEqu2Azi 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 Altitude 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

    sdEqu2Alt(-15,sdDMS2D(sdDMSSouth,33,53,0),23) equals 31.35 degrees.