设为首页 加入收藏

TOP

UVA - 11646 - Athletics Track (计算几何~)
2015-07-20 17:18:56 来源: 作者: 【 】 浏览:2
Tags:UVA 11646 Athletics Track 计算 几何

?

?

?

?

\

\

?

?

?

?

?

思路:计算几何入门题,首先,两个圆弧是同一个圆的,所以这个圆是矩形的外接圆,那么矩形中心就是圆心,由长宽算出角度和半径(这时用单位长度表示),再算出一个单位长度的实际长度,从而得出长和宽

?

?

AC代码:

?

#include 
  
   
#include 
   
     #include 
    
      #include 
     
       #include 
      
        using namespace std; int main() { double a, b, le, wi, tmp; int cas = 1; while(scanf("%lf : %lf", &a, &b) != EOF) { double ang = 2 * atan(b / a); //根据长和宽的比算出角度 double r = sqrt(a * a + b * b) / 2; //算出半径的单位长度 double hu = r * ang; //算出弧的单位长度 double Unit_length = 200.0 / (hu + a); //算出单位长度的实际长度 le = a * Unit_length, wi = b * Unit_length; //求长和宽的实际长度 printf("Case %d: %.10lf %.10lf\n", cas++, le, wi); } return 0; } 
      
     
    
   
  


?

?

?

?

?

?

?

?

?

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇zoj 3822概率dp 下一篇poj2431(优先队列)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·MySQL 基础入门视频 (2025-12-26 23:20:22)
·小白入门:MySQL超详 (2025-12-26 23:20:19)
·关于 MySQL 数据库学 (2025-12-26 23:20:16)
·SOLVED: Ubuntu 24.0 (2025-12-26 22:51:53)
·Linux 常用命令最全 (2025-12-26 22:51:50)