2575: Moveable quadrangle with three edges
来源:互联网 发布:js回调函数是什么意思 编辑:程序博客网 时间:2024/06/06 00:32
2575: Moveable quadrangle with three edges
我们知道,四边形是可以移动和不稳定的。给定三个相连的边a,b和c,它们之间的夹角可以活动,第四条边由两边的顶点虚拟连线构成,这个四边形的面积随不同的夹角变化。请找出最大的四边形面积。
Input
输入的每一行代表一个Case。每一行有三个正浮点数,分别是a,b,c。
Output
对于每一个输入,计算最大的四边形的面积。输入四舍五入到小数点后4位。
Sample Input
1 1 1.01 2 1.0
Sample Output
1.29902.2018数学几何的题目一定要学会划分,接着用各种怪异的方法写出来。
附上ZZC大牛的代码,这是他第一次的代码
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
const double PI = acos(-1.);
int main(void)
{
double a, b, c;
while(scanf("%lf%lf%lf", &a, &b, &c) != EOF)
{
double p = 1e-5;
double area = 0, tmp;
for(double radius = 0; radius <= PI; radius += p)
{
double d = sqrt(a * a + b * b - 2 * a * b * cos(radius));
tmp = a * b * sin(radius) / 2 + d * c / 2;
if(tmp > area)
area = tmp;
}
printf("%lf",PI);
printf("%.4lf/n", area);
}
return 0;
}
- 2575: Moveable quadrangle with three edges
- joj 2575: Moveable quadrangle with three edges ()
- moveable layer
- [2_4_shortest_path_text] BFS => Shortest Path for Graphs with many Vertices buf few Edges
- geeksforgeeks Count all possible walks from a source to a destination with exactly k edges
- HDOJ 1236 with three methods using C++
- 马士兵动态代理Moveable
- HDU3694Fermat Point in Quadrangle
- UVa11455 - Behold my quadrangle
- Three
- three
- three
- three
- Threejs 官网 - Three.js 的图形用户界面工具(GUI Tools with Three.js)
- Static Equilibrium for a Plate with Support at Three Points
- Three ways of dealing with Alert in automation(Python+Webdriver)
- WebGL With Three.js – Lesson 6(转)
- HDU 4097 - Triangles and Quadrangle
- part
- WebLogic的安装与使用
- VC编译器的#pragma的用法
- 关于屏幕的函数
- Microsoft .NET Framework 3.5 sp1离线安装解决方案
- 2575: Moveable quadrangle with three edges
- USB概述
- DB29 for Linux,UNIX,and WINDOWS - section 6(DB2 SQL)
- WINCE 对话框中添加MENU
- 5.1运行时动态识别
- 已知3点,求平面方程,点到面的距离
- 关于pager-taglib的安装与使用
- HOOK 改变API函数行为
- 软件复杂度概述