Arduino-trigonometric-functions

提供:Dev Guides
移動先:案内検索

Arduino-三角関数

移動するオブジェクトの距離や角速度を計算するのと同じように、三角法を実際に使用する必要があります。 Arduinoは、プロトタイプを書くことで要約できる従来の三角関数(sin、cos、tan、asin、acos、atan)を提供します。 Math.hには、三角関数のプロトタイプが含まれています。

三角関数の正確な構文

double sin(double x);//returns sine of x radians
double cos(double y);//returns cosine of y radians
double tan(double x);//returns the tangent of x radians
double acos(double x);//returns A, the angle corresponding to cos (A) = x
double asin(double x);//returns A, the angle corresponding to sin (A) = x
double atan(double x);//returns A, the angle corresponding to tan (A) = x

double sine = sin(2);//approximately 0.90929737091
double cosine = cos(2);//approximately -0.41614685058
double tangent = tan(2);//approximately -2.18503975868