关于三角函数

\(C++\)中\(cos\),\(sin\),\(tan\),\(asin\),\(acos\),\(atan\)这些三角函数操作都是弧度制

\(弧度=角度*\frac{\pi }{180}\)

\(double\ sin\left ( double\right )\)

\(double\ cos\left ( double\right )\)

\(double\ tan\left ( double\right )\)

\(double\ asin\left ( double\right )\)

\(double\ acos\left ( double\right )\)

\(double\ atan\left ( double\right )\)

 

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 typedef long long ll;
 4 const double pi=acos(-1.0);
 5 
 6 int main()
 7 {
 8     double f;//角度
 9     double s;//弧度
10     cin>>f;
11     s=f*pi/180;
12     cout<<fixed<<setprecision(10)<<sin(s)<<endl;
13     return 0;
14 }

 

posted @ 2020-05-10 10:30  swsyya  阅读(209)  评论(0)    收藏  举报

回到顶部