首页 > 编程知识 正文

如何通过三角函数求角度,如何通过直线调整角度

时间:2023-05-06 07:17:36 阅读:278278 作者:2592

题目描述

圆周率为3.1415926,求45度、90度的余弦值

详细C++代码如下:

#include<iostream>#include<math.h>#include<conio.h>using namespace std;int main(){float x = 45.0;float y = 90.0;float PI = 3.1415926;float xh = PI * x / 180.00;float yh = PI * y / 180.00;float cosVal = cos(xh);printf("cos of %f is : %lfn", x, cosVal);cosVal = cos(yh);printf("cos of %f is : %lfn", y, cosVal);getch();return 0;}

运行结果:

对应的C代码

#include <stdio.h>#include <math.h>#include <conio.h>main(){float x=45.0;float PI=3.1415926;float xh=PI*x/180.00;float cosVal=cos(xh);printf("cos of %f is :%lfn",x,cosVal);getch();} 之后我会持续更新,如果喜欢我的文章,请记得一键三连哦,点赞关注收藏,你的每一个赞每一份关注每一次收藏都将是我前进路上的无限动力 !!!↖(▔▽▔)↗感谢支持!

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。