1024: Midterm Exam Problem 3
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:215
Solved:42
Description
A point (x,y) in the Cartesian coordinate rotating about the origin over t radians is calculated by the linear transformation
x1 = cos(t) x - sin(t) y
y1 = sin(t) x + cos(t) y
x1 = cos(t) x - sin(t) y
y1 = sin(t) x + cos(t) y
Write a program in C language to rotate a point (x,y) in Cartesian plane about a pivot point (x0,y0) over a t radian. The number in the answer contains three digits in the fractional part. The input writes,
x y x0 y0 t
and the output writes,
x1 y1
Notice the output has 3 digits in the fractional part.
Input
5 5 1 1 0.5
Output
2.593 6.428
Sample Input Copy
30 5 -10 1 2
Sample Output Copy
-30.283 35.707