Turn around.
Time limit:1000 MS |
Memory limit:65536 KB |
Total submissions:25 |
Accepted:8 |
Description
On a two-dimensional plane, there is a fixed circle and a fixed point (to ensure that the point is not on the circle), and a moving point on the circle with angular velocity
W
go around the center of the circle. In the
T
moment, connecting the moving point to a fixed line
k
, ask for a straight line
k
the length of the segment truncated by the circle (that is, the line
k
part length within the circle).
The starting point of the move is in the three o'clock direction of the circle (that is, parallel to the positive x - axis), and rotates in a counterclockwise direction.
?
Input
Enter an integer tto represent the T(t<50) group data.
seven real numbers per group of data A,b,r (r>0), X,y,w (w>=0), T (t>=0) represents the center coordinate of a circle, respectively A, b ), Radius R, fixed point coordinates (x, y) , angular velocity W, the moment to query T .
The absolute value of all the above data is less than 10000.
Output
The output answer occupies one line, leaving 2 decimal places.
Sample Input
1
1 1 1 3 1 3 0
Sample Output
2.00
Hint
Angular Velocity Definition:
A circle in radians (a circumference of 2π, i.e., 360 degrees =2π), which is the angular velocity in the unit time.
A purely mathematical problem.
Using two-point, point-to-line distance formula, Pythagorean Theorem solution can
It's important to note that
Double input with%LF output with%f
Or there's going to be a strange problem.
AC Code: GITHUB
1 /*2 By:ohyee3 Github:ohyee4 Homepage:http://www.oyohyee.com5 email:[email protected] ' e.com6 Blog:http://www.cnblogs.com/ohyee/7 8 かしこいかわいい? 9 エリーチカ! Ten to write out the хорошо code OH ~ One */ A -#include <cstdio> -#include <algorithm> the#include <cstring> -#include <cmath> -#include <string> -#include <iostream> +#include <vector> -#include <list> +#include <queue> A#include <stack> at#include <map> - using namespacestd; - - //DEBUG MODE - #defineDebug 0 - in //Loops - #defineREP (n) for (int o=0;o<n;o++) to + Const DoublePI =3.1415926; - the voidDo () { * Doublea,b,r,x,y,w,t; $scanf"%LF%LF%LF%LF%LF%LF%LF",&a,&b,&r,&x,&y,&w,&t);Panax Notoginseng - DoubleXB = a + R * cos (w*t); the DoubleYB = B + R * Sin (w*t); + A DoubleA = y-YB; the DoubleB = XB-x; + DoubleC = x * YB-XB *y; - $ DoubleL = ABS (A * a + b * b + C)/sqrt (A * a + b *B); $ - DoubleAns =2* SQRT (R * r-l *l); - theprintf"%.2f\n", ABS (ANS)); - }Wuyi the intMain () { - intT; Wuscanf"%d",&T); - while(t--) About Do (); $ return 0; -}
Hfut 1356. Turn and turn (Anhui Province 2016 "Beijing Sheng Cup" program design contest E)