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

Sunlit Design > The Sun API > Documentation > sdD2Unit Function


Index


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

Contact Developer

Downloads

sdD2Unit Function

Description

Returns the result of converting a degree value to another unit

Syntax

sdD2Unit(degree,tounit)

degree    a numeric value to be converted

tounit    a constant value showing which unit to convert to.

Return Values

sdD2Unit returns a double precision number.

Errors

If this function finds any errors in it's input parameter(s) it returns -99999999

Remarks

The function converts between units of time (Day, Hour, Minute, Second) and units of rotation (Degree, Arcminute, Arcsecond, Radian) on the basis that:

  • 24 hours = 360 degrees and

  • 24 hours = 2pi radians and

  • 1 hour = 15 degrees and

  • 4 minutes = 1 degree, etc.

You can convert a value in another unit to degrees using the complementary sdUnit2D function.

Example

 To convert 23.45 degrees to radians
    sdD2Unit(23.45,sdUnitRadian)equals 0.40927970959267...