Home

Math Functions: Degrees To Radius Conversion

     

Introduction

Extended __fastcall DegToRad(Extended Degrees);

The DegToRad() function is used to calculate the equivalent value of an angle from degrees to radians. This function follows the formula:

2Pi rad = 360˚

which is

1 rad = 360˚ / 2Pi = 180˚ / Pi = 57.3˚

Here is an example:

//---------------------------------------------------------------------------
void __fastcall TForm1::btnConversionClick(TObject *Sender)
{
	Extended Deg = StrToFloat(edtDegrees->Text);
	Extended Rad = DegToRad(Deg);
	
	edtRadians->Text = FloatToStr(Rad);
}
//---------------------------------------------------------------------------
Degrees To Radius Conversion
   

 

   
     
 

Home Copyright © 2010-2016, FunctionX