UVAlive 3485 Bridge(抛物线弧长积分)】的更多相关文章

Bridge A suspension bridge suspends the roadway from huge main cables, which extend from one end of the bridge to the other. These cables rest on top of high towers and are secured at each end by anchorages. The towers enable the main cables to be dr…
题目大意 你的任务是修建一座大桥.桥上等距地摆放着若干个塔,塔高为H,宽度忽略不计.相邻两座塔之间的距离不能超过D.塔之间的绳索形成全等的对称抛物线.桥长度为B,绳索总长为L,如下图所示求建最少的塔时绳索的最下端离地的高度y. [输入格式] 输入第一行为测试数据组数T.每组数据包含4个整数D,H,B,L(B<=L). [输出格式] 对于每组数据,输出绳索底部离地高度,保留两位小数. 间隔数为n=[(B+D-1)/D],所以间隔和每个间隔的绳子长分别为w=B/n,L=L/n 根据微积分,一个二次函…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4752 题意:给出一个抛物线和一个简单多边形.求抛物线在多边形内部的长度. 思路:首先求出多边形所有边和抛物线的交点.这里要注意: (1)边和抛物线相切不算,因为整个抛物线在边的另一侧: (2)如下,上面两种相交都是不能算的,下面一种要算. 算出所有交点之后,那么每相邻两个交点与抛物线的关系必然是抛物线交替进入-离开.下面对于一段[x1,x2]计算抛物线的长度. struct point { doub…
自适应辛普森公式模板. #include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #include<vector> #include<queue> #include<cmath> #include<map> #include<set> #define LL long long #define CLR(a, b)…
桥的间隔数为n = ceil(B/D),每段绳子的长度为L / n,相邻两塔之间的距离为 B / n 主要问题还是在于已知抛物线的开口宽度w 和 抛物线的高度h 求抛物线的长度 弧长积分公式为: 设抛物线方程为f(x) = ax2,则这段抛物线弧长为 查积分表或者自己分部积分算一下:  二分抛物线高度x,使得每段抛物线长度为L / n,所求答案为H - x #include <cstdio> #include <cmath> inline double F(double a, do…
在曲线参数化的Javascript实现(理论篇)中推出了曲线弧长积分的公式,以及用二分法通过弧长s来查找样条曲线上对应的u,再求Q(u)的值.弧长积分函数如下: ,其中-----公式1 Simpson展开后 -------公式2 这里的f(u)就是上面的弧长s的求值函数,既样条曲线拟合函数Q(u)的积分 这部分具体代码如下:1.计算f(u)的系数ABCDE CParametric.prototype.SegCoef = function(CSpline, o) { p0.x=this.k[0]*…
1.LA 5694 Adding New Machine 关键词:数据结构,线段树,扫描线(FIFO) #include <algorithm> #include <cstdio> #include <cstring> #include <string> #include <queue> #include <map> #include <set> #include <ctime> #include <cm…
uva 1356 Bridge ( 辛普森积分 ) 不要问我辛普森怎么来的,其实我也不知道... #include<stdio.h> #include<math.h> #include<string.h> #include<algorithm> using namespace std ; double d , h , m , b , l , w ; double f ( double x ) { double a = 4.0 * m / w / w ; re…
Problem Description Ignatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the intersectant points shows in the picture…
UVA 1356 - Bridge option=com_onlinejudge&Itemid=8&page=show_problem&category=493&problem=4102&mosmsg=Submission+received+with+ID+13932460" target="_blank" style="">题目链接 题意:一个桥长为B,桥上建电线杆.杆高为H,两杆之间距离不超过D.电线杆总长…