Whatever formula you're using is clearly incorrect anyway, as it gives negative area at alpha >= 37.83.
Also, why suddenly use angle in degrees in this kata? You used angles in radians in the previous kata. It seems that your katas are inconsistent with themselves.
Drop input validation (negative values).
Tests crash when run with initial solution.
This comment is hidden because it contains spoiler information about the solution
Running the initial solution (or indeed any solution which returns a non-numeric value) reveals the solution to the user in the stack trace.
Reraising: random tests have bare assertions inside a describe
Random test code is extremely bizarre and should probably be modified:
This comment is hidden because it contains spoiler information about the solution
Kata cannot be passed since there's no assertion done when all of the results are correct.
You should use
test.assert_approx_equals
instead, or add else statement containingtest.pass_()
in theassert_almost_equal
function.Whatever formula you're using is clearly incorrect anyway, as it gives negative area at
alpha >= 37.83
.Also, why suddenly use angle in degrees in this kata? You used angles in radians in the previous kata. It seems that your katas are inconsistent with themselves.
This comment is hidden because it contains spoiler information about the solution
The title
"should return '12' for (0, 2)"
is incorrect, and very misleading.a, a+1
.