UVALive 4579 Time Lapse Camera
来源:互联网 发布:上海税友有哪些软件 编辑:程序博客网 时间:2024/05/16 14:56
[Submit]
Description
Henry has a time lapse camera that can take a set of 3 images inone shot. The three images are taken by the camera at differenttime lapse. For example, if the first image is taken at 0.33seconds after the shot, then the second image is automaticallytaken at 0.51 seconds and the third image is taken at 0.62 secondsafter the shot. The time lapses of taking the images are notreliable but the spatialcoordinate
One nice evening during a sport festival, Henry placed a gridnet in front of camera and started shooting the movement of a ball.Once the images were developed, Henry measured and recorded thecoordinates of the ball on each image. Now he wants to know thehighest height that the ball had achieved in a set of 3 images.
You need to help Henry by writing a program to compute theapproximation of height that the ball has achieved in each set ofimages by assuming that the movement of the ball forms a paraboliccurve.
Input
A test case consists of the coordinate of 3 points where theball was captured by the camera. Input consists of several testcases. Each coordinate will not exceed 500.0 in absolute value. Theinput is terminated by a zero on a line by itself.
Output
Approximation of highest height that the ball has achieved ineach test case
SampleInput
20, 2550, 2535, 3015, 1712, 2316, 1115, 1225, 2035, 250
SampleOutput
Test case 1: 30.00Test case 2: 23.25Test case 3: 27.04
#include<stdio.h>int main()
{
char p;
int k=1;
double a,b,c,x1,x2,x3,y1,y2,y3;
while(~scanf("%lf",&x1))
{
if(!x1) break;
else
scanf("%c%lf",&p,&y1);
scanf("%lf, %lf",&x2,&y2);
scanf ("%lf, %lf",&x3,&y3);
b=y2-y3-(y1-y2)*(x2*x2-x3*x3)/(x1*x1-x2*x2);
b/=(x2-x3-(x2*x2-x3*x3)/(x1+x2));
a=(y1-y2-b*(x1-x2))/(x1*x1-x2*x2);
c=y1-a*x1*x1-b*x1;
printf ("Test case %d: %.2lf\n",k++,c-b*b/4/a);
}
return 0;}
- UVALive 4579 Time Lapse Camera
- 什麼是 Time Lapse
- Depth Camera: Time of flight
- Real Time Camera 技术要点总结
- MonoSLAM: Real-Time Single Camera SLAM
- UVALive 4839 HDU 3686 Traffic Real Time Query System
- UVALive 4839 HDU 3686 Traffic Real Time Query System
- Real-Time Camera Tracking and 3D Reconstruction
- DVS128,Event Camera Real-Time 3D Reconstruction
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- hdu 1066 阶乘最后非0位
- hdu 1039
- hdu 1019 最小公倍数(LCM)
- CodeForces 104 B 猜答案
- CodeForces 104A
- UVALive 4579 Time Lapse Camera
- hdu 3940 愤怒的小鸟
- linux - yum 安装配置mysql
- hdu 2031 进制转换
- hdu 1021 Fibonacc Again 找规律
- hdu 2036 改革春风吹满地
- 爱数发布AnyShare 3.5,打造私有云存储的BOX
- hdu 2043
- Visual Studio 2012完美的拥抱GitHub