| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
FT,这个算的是什么?In Reply To:最后我要改成这样子才过 Posted by:frkstyc at 2005-06-05 11:03:29 > int x, y, r, dx, dy, a, b, c;
> double k;
> scanf("%d %d %d", &x, &y, &r);
> dx = x - X;
> dy = y - Y;
> a = -dx * dy;
> b = dx * dx + dy * dy - r * r;
> c = dy * dy - r * r;
> k = (a - r * sqrt(b)) / c;
> rec[i].x = X + k * Y;
> rec[i].sign = 1;
> k = (a + r * sqrt(b)) / c;
> rec[i + N].x = X + k * Y;
> rec[i + N].sign = -1;
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator