#K7731. Point Translation

    ID: 34836 Type: Default 1000ms 256MiB

Point Translation

Point Translation

You are given a point with coordinates \(x\) and \(y\) on the Cartesian plane, a distance \(d\), and an angle \(\theta\) (in degrees measured from the positive x-axis). The task is to compute the translated point \((x', y')\) after moving the original point by a distance \(d\) in the direction \(\theta\).

The formulas to compute the new coordinates are given below in \(\LaTeX\) format:

\( x' = x + d \cos(\theta) \)

\( y' = y + d \sin(\theta) \)

Output the result as two floating point numbers rounded to four decimal places.

inputFormat

The input is given via standard input (stdin) and consists of four space-separated numbers:

  • x: a float, the x-coordinate of the original point
  • y: a float, the y-coordinate of the original point
  • d: a float, the distance to move the point
  • \(\theta\): a float, the angle in degrees from the positive x-axis

outputFormat

The output, printed to standard output (stdout), should consist of two space-separated floating point numbers \(x'\) and \(y'\) which are the translated coordinates, each rounded to four decimal places.

## sample
1.0 1.0 5.0 0
6.0 1.0