234 of 318
ZBasic System Library 224 ZX Microcontroller Family RadToDeg Type Function returning Single Invocation RadToDeg(angle) Parameter Method Type Description angle ByVal Single The angle, in radians, to convert to degrees. Discussion The trigonometric functions in the System Library all use radian angle measure. Depending on the programming task, it is sometimes more convenient to think of angles in terms of degrees. This function and its inverst DegToRad() facilitate the conversion between the two systems. Depending on optimization settings, if the parameter supplied to this function is known to be constant at compile time, the compiler will convert the value at compile time. Otherwise, code is generated to perform the conversion (multiplication by a conversion factor) at run time. Example Dim f as Single Dim theta as Single ' the angle in degrees theta = RadToDeg(Asin(f)) Compatibility This function is not available in BasicX compatibility mode. See Also DegToRad