Go Down

### Topic: Sin() and other math calculacion (Read 11014 times)previous topic - next topic

#### mrax ##### Sep 27, 2015, 09:36 pm
Hi,

I have problem with matematic.

when i calculate (with desktop calculator) sin(40)*85 result is 54,63
but
when i put this formula in arduino result is 63,33

I need result like desktop calculator. How

#### mrax #1
##### Sep 27, 2015, 10:14 pm
I find solutioin.

#### econjack #2
##### Sep 29, 2015, 02:13 am
Also, the math function usually require floating point numbers, so it's best to write the statement as:

The use of the decimal point makes it clear that floating point calculations are required.

#### akbarkhan #3
##### Sep 21, 2016, 05:04 pmLast Edit: Sep 21, 2016, 05:10 pm by akbarkhan
Here is the prototype of sin function of math.h library.
double sin(double x);
x : A floating point value representing an angle in radians.
If you have angle in degree then you can convert it to radian by multiplying it with (3.14/180). Hope it helps.

#### daljitgroup #4
##### Nov 30, 2016, 09:10 am
thank you Mrax it is beneficial for me also.

Go Up