Home

Measure-Based Functions:
Cycle To Radius Conversion

 
Extended __fastcall CycleToRad(Extended Cycles);

The CycleToRad() function is used to convert the measurement of an angle from radians to cycles. This function is equivalent to using the formula

Radian = 2Pi * Cycle

Here is an example:

//---------------------------------------------------------------------------
#include <MATH.HPP>
#include <vcl.h>

#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------

#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{

}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnConversionClick(TObject *Sender)
{
	Extended Cyc = StrToFloat(edtCycle->Text);
	Extended Rad = CycleToRad(Cyc);
	
	edtRadian->Text = FloatToStr(Rad);
}
//---------------------------------------------------------------------------

 

Home Copyright © 2004-2016, FunctionX, Inc.