The top answer in Average of two angles with wrap around is wrong per testing + the comments.
The bottom answer 12>
math:atan( (math:sin(180)+math:sin(270)) / (math:cos(180)+math:cos(270))).
-1.1946710584651132
but I get -1.946.. instead of the expected 225.
Erlang's math:atan
isn't behaving according to http://rapidtables.com/calc/math/Arctan_Calculator.htm , however, which gives different results .
How do I find the average of 2 angles in a circle?
Edit: Attempting to use Radians. Degrees are 180 and 270.
16> A = 180 * 3.14 / 180.
3.14
17> B = 270 * 3.14 / 180.
4.71
18> S = math:sin(A) + math:sin(B).
-0.9984044934712312
19> S2 = S / 2.
-0.4992022467356156
20> C = math:cos(A) + math:cos(B).
-1.002387709839821
21> C2 = C / 2.
-0.5011938549199105
22> math:atan(S, C).
** exception error: undefined function math:atan/2
23> math:atan(S/C).
0.7834073464102068
24> math:atan(S/C) * 180 / 3.14.
44.90870138657236
25> math:atan(S2/C2) * 180 / 3.14.
44.90870138657236
Conversion: -1.19 to degrees = -68.18198.3 360 - 68 = 292. This isn't the expected 225.