Description |
The DegToRad function is a mathematical function converting a Degrees value to Radians
PI radians = 180 degrees
|
|
Related commands |
|
|
|
Example code : Get the Sine of 30 degrees |
// Full Unit code. // ----------------------------------------------------------- // You must store this code in a unit called Unit1 with a form // called Form1 that has an OnCreate event called FormCreate. unit Unit1; interface uses Math, // Unit containing the DegToRad command SysUtils, Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} // Include form definitions procedure TForm1.FormCreate(Sender: TObject); var
float : single;
begin // The Sine of 30 degrees = 0.5
float := Sin(DegToRad(30));
ShowMessage('Sine off 30 degrees = '+FloatToStr(float));
end; end.
|
Hide full unit code |
Sine of 30 degrees = 0.5
|
|