C语言弧度转度数程序
如果输入以弧度为单位,则将其转换为度数,否则输入将以弧度为单位转换为度数。有可用于此转换的公式。
弧度是测量角度的标准单位,而圆的完整角度则分为 360 度。此外,弧度是较小的值,因为 1 度 = 180 弧度。
转换公式 −
degree = radian * (180/pi) where, pi=3.14 or 22/7
示例
Input-: radian = 9.0 Output-: degree is : 515.92357
算法
Start Step 1 -> define macro as #define pi 3.14 Step 2 -> declare function for converting radian to degree double convert(double radian) return(radian * (180/pi)) Step 3 -> In main() Declare variable as double radian = 9.0 Declare and set double degree = convert(radian) Print degree Stop
示例
#include <stdio.h> #define pi 3.14 // Function for converting radian to degree double convert(double radian){ return(radian * (180/pi)); } int main(){ double radian = 9.0; double degree = convert(radian); printf("degree is : %.5lf", degree); return 0; }
输出
degree is : 515.92357
广告