xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DtoR()

Converts an angle from degrees to radians.

Syntax

DtoR( <nDegrees> ) --> nRadians

Arguments

<nDegrees>
A numeric value in the range of 0 to 360 degrees

Return

The numeric return value is the angle in radians.

Info

See also:RtoD()
Category: CT:Math , Conversion functions , Mathematical functions , Trigonometric functions
Source:ct\trig.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays results of function DtoR().

   PROCEDURE Main
      ? DtoR(   0 )   // result: 0.00
      ? DtoR(  45 )   // result: 0.79
      ? DtoR(  60 )   // result: 1.05
      ? DtoR(  90 )   // result: 1.57 (qtr. circle = Pi()/2)
      ? DtoR( 120 )   // result: 2.09
      ? DtoR( 180 )   // result: 3.14 (half circle = Pi())
      ? DtoR( 240 )   // result: 4.19
      ? DtoR( 300 )   // result: 5.24
      ? DtoR( 360 )   // result: 6.28 (full circle=2*Pi())
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe