当前位置:网站首页>【C语言程序】求直角三角形边长
【C语言程序】求直角三角形边长
2022-08-02 04:03:00 【丘比特惩罚陆】
求直角三角形两个边长的长度:已知斜边长度L,求2个直角边:X,Y长度。

编程思路分析
编程思路:
调用C语言的库函数,用sin函数和cos函数计算出直角边。
知道边的长度,很容易就可以求得另一条边的长度。
程序范例
#include <stdio.h>
#include <math.h>
void main()
{
float a,b,R,L,r;
printf("请输入斜边长度:");
scanf("%f",&L);
printf("请输入其中一斜角度数:");
scanf("%f",&r);
R=r/180*3.1415926; //计算弧度
a=sin(R)*L; //计算一直角边
b=cos(R)*L; //计算另一直角边
printf("%.2f\n",a);
printf("%.2f\n",b);
}

边栏推荐
- SCI writing strategy - with common English writing sentence patterns
- 深度学习基础之批量归一化(BN)
- RuoYi-App启动教程
- MapFi paper structure organization
- 多主复制下处理写冲突(3)-收敛至一致的状态及自定义冲突解决逻辑
- Qt处理传输协议数据时QByteArray添加多字节的使用案例
- BOM学习
- OpenPCDet environment configuration of 3 d object detection and demo test
- Centos7下使用systemd管理redis服务启动
- 如何让固定点的监控设备在EasyCVR平台GIS电子地图上显示地理位置?
猜你喜欢

CaDDN code debugging

Scientific research notes (5) SLAC WiFi Fingerprint+ Step counter fusion positioning

吴恩达机器学习系列课程笔记——第十四章:降维(Dimensionality Reduction)

Deep blue college - handwritten VIO operations - the first chapter

Research Notes (6) Indoor Path Planning Method Based on Environment Perception

安装部署 Kubernetes 仪表板(Dashboard)

单目3D目标检测之入门

CaDDN代码调试

无主复制系统(1)-节点故障时写DB

日本痴汉打赏女主播1.5亿,结果。。。
随机推荐
多主复制下处理写冲突(4)-多主复制拓扑
七月阅读:《刘慈欣科幻短篇小说集Ⅰ》笔记
The CCF brush topic tour - the first topic
复制延迟案例(3)-单调读
MySQL存储函数详解
Qt编写物联网管理平台49-设备模拟工具
吴恩达机器学习系列课程笔记——第十三章:聚类(Clustering)
Nexus 5手机使用Nexmon工具获取CSI信息
数据可视化之百变柱状图
Deep Blue Academy - 14 Lectures on Visual SLAM - Chapter 7 Homework
普氏分析法-MATLAB工具箱函数
Your device is corrupt. It cant‘t be trusted and may not work propely.
CaDDN code debugging
今天突然下雨
Research Notes (8) Deep Learning and Its Application in WiFi Human Perception (Part 1)
ADSP21489仿真:Failed to set breakpoint: Can‘t set breakpoints in the current state: Running
nr部分计算
Deep blue college - handwritten VIO operations - the first chapter
吴恩达机器学习系列课程笔记——第十五章:异常检测(Anomaly Detection)
从事功能测试1年,裸辞1个月,找不到工作的“我”怎么办?