Introduction: Arduino : Trigonometric Inverse Functions

Picture of Arduino : Trigonometric Inverse Functions

a basic series solution to calculate inverse trigonometric function on arduino

Step 1: Paste This Function After Void Loop()

Picture of Paste This Function After Void Loop()

/*
solutions are in radian use asin(), acos, atan();

By- ABHILASH PATEL

*/

float asin(float c){

float out;

out= ((c+(c*c*c)/6+(3*c*c*c*c*c)/40+(5*c*c*c*c*c*c*c)/112+

(35*c*c*c*c*c*c*c*c*c)/1152 +(c*c*c*c*c*c*c*c*c*c*c*0.022)+

(c*c*c*c*c*c*c*c*c*c*c*c*c*.0173)+(c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*.0139)+

(c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*0.0115)+(c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*0.01)

));

//asin

if(c>=.96 && c<.97){out=1.287+(3.82*(c-.96)); }

if(c>=.97 && c<.98){out=(1.325+4.5*(c-.97));} // arcsin

if(c>=.98 && c<.99){out=(1.37+6*(c-.98));}

if(c>=.99 && c<=1){out=(1.43+14*(c-.99));}

return out;}

float acos(float c)

{float out;

out=asin(sqrt(1-c*c));

return out;}

float atan(float c)

{float out;

out=asin(c/(sqrt(1+c*c)));

return out;}

Step 2: Comparing Calculated Value to Analystical Value for Arcsin

Picture of Comparing Calculated Value to Analystical Value for Arcsin

Step 3: Comparing Calculated Value to Analystical Value for Arctan

Picture of Comparing Calculated Value to Analystical Value for Arctan

Comments

About This Instructable

2,220views

4favorites

More by abhilash_patel:DIY: Arduino Based RC Transmitter and ReceiverSolar RC Plane Under 60$Simple Arduino Trigger for DSLR
Add instructable to: