DelphiBasics
DegToRad
Function
Convert a degrees value to radians Math unit
 function DegToRad(const Degrees Extended):Extended;
Description
The DegToRad function is a mathematical function converting a Degrees value to Radians
 
PI radians = 180 degrees
Related commands
CelsiusToFahrenheitConvert a celsius temperature into fahrenheit
ConvertConvert one measurement value to another
FahrenheitToCelsiusConvert a fahrenheit temperature into celsius
RadToDegConverts a radian value to degrees
 Download this web site as a Windows program.




 
Example code : Get the Sine of 30 degrees
var
  float : single;
begin
  // The Sine of 30 degrees = 0.5
  float := Sin(DegToRad(30));
  ShowMessage('Sine off 30 degrees = '+FloatToStr(float));
end;
Show full unit code
  Sine of 30 degrees = 0.5
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page