Home

Math Functions: Cycle To Radius Conversion

     

Introduction

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 <vcl.h>
#include <math.hpp>
#pragma hdrstop

#include "Exercise.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TfrmExercise *frmExercise;
//---------------------------------------------------------------------------
__fastcall TfrmExercise::TfrmExercise(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmExercise::btnConvertClick(TObject *Sender)
{
    Extended Cyc = StrToFloat(edtCycle->Text);
	Extended Rad = CycleToRad(Cyc);

	edtRadian->Text = FloatToStr(Rad);
}
//---------------------------------------------------------------------------
Cycle to Radian
   

 

   
     
 

Home Copyright © 2010-2016, FunctionX