sgu151 Construct a triangle
来源:互联网 发布:淘宝网乐町女装 编辑:程序博客网 时间:2024/06/05 08:51
三角形ABC,M是BC边上的终点,给出AB=c.AC=b,AM=m,求任意一组符合的三角形三点坐标。
首先令A为原定,B为(0,c),然后将三角形补成一个平行四边形,其一般为边长分别问b,c,2m的三角形ABA',ACA',然后通过余弦定理求出cos(角ABA'),此时画个图,根据平行线的同位角相等,会发现Cos=Yc/b,然后C的x,y就都有了...
#include <iostream>#include <cstdio>#include <algorithm>#include <cmath>using namespace std;typedef long long ll;double a,b,c,m,n,p,q,k;const double eps=1e-7;int main(){// freopen("in.txt","r",stdin); cin>>c>>b>>m; if ( (m*2-(b+c)>eps) || (b-(2*m+c)>eps) || (c-(2*m+b)>eps)) { cout<<"Mission impossible"<<endl; return 0; } printf("0.00000 0.00000\n"); printf("0.00000 %.5lf\n",c); double cc=((b*b+c*c-4*m*m)/(2*c*b)); double x,y; y=-b*cc; x=sqrt(b*b-y*y); printf("%.5lf %.5lf\n",x,y); return 0;}
0 0
- sgu151 Construct a triangle
- sgu151:Construct a triangle
- sgu151: Construct a triangle
- sgu 151 Construct a triangle
- SGU 151 - Construct a triangle
- SGU 151 Construct a triangle(数学)
- A. Triangle
- A. Triangle
- Construct a Matrix FZU
- foj 1911 Construct a Matrix
- How to construct a DiamondOfNumbers
- FZU 1911 Construct a Matrix
- FZU 1911Construct a Matrix
- Rendering a triangle
- CF 6 A - Triangle
- HDU3188:Just A Triangle
- codeforces Round6 A. Triangle
- codeforces 18A - Triangle
- 求10以内的偶数
- Linux学习笔记 - Linux 核心編譯與管理
- 【珍藏】 2012Android开发热门资料(110个)下载地址
- 物理standby database的日常维护
- 监控CPU使用率的三种方法(shell脚本)
- sgu151 Construct a triangle
- 产品免费了,然后该怎么做下去?
- 巧用nat123端口映射,解决WEB网站80端口被封被屏蔽的问题
- Tomcat5启动流程与配置详解
- 内部类--加油!
- Spring整合Hibernate开发 - 使用事务管理器操作数据库 - 主配置文件
- push推送详解
- Linux学习笔记 - 伺服器架设
- ANE打包教程