2021牛客暑期多校训练营1 B.Ball Dropping

本文探讨了一个高中数学问题,通过构建几何模型来判断一个标准球体下落时是否会卡在一个空心等腰梯形内部。利用相似三角形原理计算关键距离,进而得出球体是否会被卡住。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

A standard sphere ball is falling in the air, and the center of the sphere is exactly on the centerline of an empty isosceles trapezoidal. The trapezoid is hanging horizontally under the sphere.
在这里插入图片描述
Please determine whether the ball will get stuck in the trapezoid or drop past the trapezoid.

思路:高中数学题,补成三角形,用相似三角形做。

代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	double r,a,b,h;
	cin>>r>>a>>b>>h;
	double h1;//b中点到三角形顶点的距离
	h1=(b/(a-b))*h;
	double H;//等腰三角形的高
	H=(a/(a-b))*h;
	double l;//小等腰三角形的斜边
	l=H*r/(a/2);
	double h0=sqrt(r*r+l*l);//球被卡住时圆心距离三角形顶点的距离
	if(h0<=h1){
		cout<<"Drop"<<endl;
	}
	else{
		cout<<"Stuck"<<endl;
		printf("%.10lf\n",h0-h1);
	}
	return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值