This is a fairly simple question. According to this random website I found — Web Archive, a reference angle is
the acute angle formed by the terminal side of the given angle and the x-axis. You have to write a program to find these.
I don't remember anything from algebra 2, what does this mean?
Angles are usually given in standard form, which is measured by placing one side of the angle and measuring to the other side, counterclockwise, like so:
This will be your input. Your output will be the reference angle of this. You can think of this as basically the smallest distance from the terminal side to the x-axis. Except it's an angle, not a distance. Here are some examples:
- All the defaults on inputs and submissions.
- Angles is in degrees.
- Negative angles, non-integer angles, and angles > 360 deg are allowed.
- Output in form
- This is code-golf, so shortest code in bytes wins!
70 -> 70 deg 135 -> 45 deg 210 -> 30 deg -60 -> 60 deg 91 -> 89 deg 610 -> 70 deg -1000 -> 80 deg