当前位置:K88软件开发文章中心编程语言APP编程Android01 → 文章内容

Arduino 三角函数

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-24 10:05:01

由 drbear 创建,youj 最后一次修改 2016-12-26 你需要使用三角几何来计算移动物体的距离或角速度。Arduino提供了传统的三角函数(sin,cos,tan,asin,acos,atan),可以通过编写它们的原型来概括。Math.h包含三角函数的原型。三角函数的精确语法double sin(double x); //returns sine of x radiansdouble cos(double y); //returns cosine of y radiansdouble tan(double x); //returns the tangent of x radiansdouble acos(double x); //returns A, the angle corresponding to cos (A) = xdouble asin(double x); //returns A, the angle corresponding to sin (A) = xdouble atan(double x); //returns A, the angle corresponding to tan (A) = x例子double sine = sin(2); // approximately 0.90929737091double cosine = cos(2); // approximately -0.41614685058double tangent = tan(2); // approximately -2.18503975868

Arduino 三角函数