Ski Jump
Time limit2sMemory limit128 MB
Given a piecewise hill profile and a take-off parabola, find where the jump lands and report the landing distance, speed, and angle from the hill tangent.
- Level
Medium6 of 10
- Topics
- Binary search, Math, Geometry, Simulation
- Solved
- No attempts yet
Problem
Ski jumping is one of the most popular winter sports. To keep athletes safe, the international ski federation sets maximum allowed values for the landing speed and the landing angle. Given the profile of a newly built ski-jumping venue, and assuming the athlete starts from the highest point of the in-run, write a program that computes the landing position, the landing speed, and the landing angle.
Use the following simplified physics. Set up a coordinate system whose -axis is horizontal, with the origin directly below the take-off point, at the top of the landing hill. Heights are measured upward from the flat outrun at the bottom of the hill. Friction and air resistance are ignored, and .
The landing hill, described by its height above the outrun as a function of the horizontal distance , is where is the height and is the width of the hill. The top of the hill (at ) is at height , and the hill descends to the flat outrun (height ) at .
The take-off point is at , at height ; that is, it lies above the top of the hill.
Starting from rest at the top of the in-run, whose vertical drop down to the take-off point is , the athlete leaves the take-off point moving horizontally. By conservation of energy the take-off speed is , so the flight path is the parabola
The athlete lands at the first point where the flight path meets the hill, i.e. the smallest with . Let be that horizontal landing distance and the landing height.
Output three quantities:
- the horizontal landing position ;
- the landing speed (m/s), which by conservation of energy equals ;
- the landing angle (in degrees): the angle between the athlete's velocity vector at the moment of landing and the tangent to the hill at the landing point.
Input
The first line contains the number of test cases (). Each of the next lines contains four integers , , , (). All values are given in meters.
Output
For each test case print, on its own line, the landing position , the landing speed , and the landing angle (in degrees), separated by single spaces. Print every value rounded to exactly six digits after the decimal point.
Hint
The landing angle is the angle between two vectors: the athlete's velocity at landing and the direction of the hill surface at that point. The dot product of two vectors and is , from which follows. Taking the tangent direction of the flight path as and of the hill as gives Here , and for , for , and for .