Home

Measure-Based Functions:
Degrees To Radius Conversion

 
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);
}
//---------------------------------------------------------------------------

 

 
Home Copyright 2004-2007 FunctionX, Inc.