LightOJ 1433 - Minimum Arc Distance
2015-10-29 21:03
267 查看
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1433
题意:给你圆心坐标及圆上的两点坐标,求两点距离。
求对应的圆心角度再求距离。水~
代码:
题意:给你圆心坐标及圆上的两点坐标,求两点距离。
求对应的圆心角度再求距离。水~
代码:
#include <iostream> #include <stdio.h> #include <cmath> #include <string> #include <string.h> using namespace std; int main() { double x0, y0, x1, y1, x2, y2; int t, cases1 = 1; scanf("%d", &t); while (t--) { scanf("%lf%lf%lf%lf%lf%lf", &x0, &y0, &x1, &y1, &x2, &y2); printf("Case %d: ", cases1++); double dis1 = sqrt((x1 - x0)*(x1 - x0) + (y1 - y0)*(y1 - y0)); double dis2 = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2)); double tmp = asinf(dis2*1.0 / 2 / dis1); double l = 2.0 *dis1; double ans = (tmp) * l; printf("%.6lf\n",ans); } return 0; }
相关文章推荐
- LightOJ 1067 Combinations 组合数取模
- LightOJ 1004 - Monkey Banana Problem
- LightOJ 1011 - Marriage Ceremonies
- LightOJ 1033 - Generating Palindromes
- LightOJ 1047 - Neighbor House
- LightOJ 1013 - Love Calculator
- LightOJ 1122 - Digit Count
- LightOJ1112——Curious Robin Hood
- lightoj-1427:Substring Frequency
- Lightoj 1027 A Dangerous Maze 概率期望
- LightOJ 1030 Discovering Gold 概率
- LightOJ 1038 概率期望
- LightOJ 1305 Area of a Parallelogram - Basic Geometry
- LightOJ 1331 Agent J - Basic Geometry
- lightOJ 1317 - Throwing Balls into the Baskets
- lightOJ 1248 - Dice (III) 概率DP
- lightOJ 1138 Trailing Zeroes (III)
- lightOJ 1197 Help Hanzo 两阶段素数筛选
- lightOJ 1214 Large Division
- lightOJ 1220 Mysterious Bacteria