#P4710. Projectile Motion: Determining the Launch Position

    ID: 17954 Type: Default 1000ms 256MiB

Projectile Motion: Determining the Launch Position

Projectile Motion: Determining the Launch Position

A small ball (treated as a point mass) is thrown horizontally from point \( A(x_0, y_0) \) (i.e. along the negative \(x\)-axis) and lands at point \( B(0,0) \) under the influence of gravity only (with \( g=10\,m\cdot s^{-2} \)). When it reaches \( B \), its speed is \( V \) and its velocity makes an angle \( \theta \) (with the horizontal). From the conservation of projectile motion:

  • The horizontal motion yields: \( x_0 + uT = 0 \) with the initial horizontal velocity \( u \) (recall \( u<0 \) since it is thrown to the left).
  • The vertical motion is given by: \( y_0 - \frac{1}{2}gT^2 = 0 \).
  • The velocity upon impact is \( (u, -10T) \), and its magnitude and direction are given by \( V \) and \( \theta \) respectively.

Because the ball is thrown horizontally, the initial velocity has no vertical component. Thus, we have \( u = -V\cos\theta \) (taking \( u \) as negative) and also \( -10T = -V\sin\theta \) which gives \( T = \frac{V\sin\theta}{10} \). From these relations, we can derive:

[ \begin{aligned} x_0 &= -uT = V\cos\theta \cdot \frac{V\sin\theta}{10} = \frac{V^2\sin\theta\cos\theta}{10},\[8pt] y_0 &= \frac{1}{2}gT^2 = 5\left(\frac{V\sin\theta}{10}\right)^2 = \frac{V^2\sin^2\theta}{20}. \end{aligned} ]

Your task is, given \( V \) (in \( m\cdot s^{-1} \)) and \( \theta \) (in degrees), to compute \( x_0 \) and \( y_0 \) in meters. (Remember to convert \( \theta \) from degrees to radians before using trigonometric functions.)

inputFormat

The input consists of a single line containing two floating-point numbers: \( V \) and \( \theta \), where \( V \) is the impact speed in \( m\cdot s^{-1} \) and \( \theta \) is the impact angle (in degrees) measured from the horizontal.

outputFormat

Output two floating-point numbers \( x_0 \) and \( y_0 \) (in meters), separated by a space. Answers within a relative or absolute error of \( 10^{-6} \) are accepted.

sample

10 45
5.000000 2.500000

</p>