DWITE Online Computer Programming Contest, November 2009, Problem 1
Angles are a vital part of game physics, and are relevant to velocities, collisions, and other interactions between objects. As such, it's important to be able to accurately calculate angles between points.
The input will contain 5 lines, each containing two points, , . All values are integer values . The angle should be calculated between the first point, the origin at , and the second point, in a clockwise direction.
It is guaranteed that both points will not be at .
The output will contain 5 lines, each a corresponding angle between the points through the origin, rounded to the nearest th of a degree. If the angle is a whole degree, output the trailing .0
.
Sample Input
71 71 100 0
100 0 71 71
0 100 0 -100
-100 0 0 -100
Sample Output
45.0
315.0
180.0
270.0
Problem Resource: DWITE
Comments