Ad
  • Custom User Avatar

    Random tests sometimes generate invalid input where angle is a multiple of 360. In this case there are no solutions, as the surface is perfectly flat:

    testing for time(158, 574, 360, 928)
    6.877953960010239e+16 should equal 6.877953960010238e+16
    
  • Custom User Avatar

    I fail to see what the purpose of this kata is if the entire derivation is in the description and we're only left with the task of transcribing the simplified equations into code.

    Also your formulas are missing a lot of parentheses, so some of them are incorrect with usual operator precedence convention. e.g g sin⁡(θ) / 1 + 1/2 should be g sin⁡(θ) / (1 + 1/2).

  • Custom User Avatar
    • Do not ask for rounding, do not do strict equality on floats. Use assertions which check equality with tolerance. See this article.
    • Your random tets present inputs, which is great, but the three fixed tests do not.
    • 500 random tests is a lot. Usual practice is to have ~100 random tests, and I think that for this particular problem, even 20 or 50 would suffice. Is 500 random tests really needed?