mathematics

There is no arduino langage, there is only C and C++.
Use C mathematic library

Don't forget in Mathematics angle unit is radian