Beta

Circle

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar

    Please, explain clearly what you mean by "a chord diving a circle into two parts" and "center angle of the chord". From what I could understand, we have something similar to the plot in the image below where the angle between AB and OC can always be 90 degrees regardless of the 1 / X ratio, and I don't think that is the thing that you're implying.

    • Unnamed Avatar

      The drawing looks correct, the angle in question is AOB, which matches the second sample test. I'm not sure about the proper terms, "cental angle" seems to be more common, but there are many results for "center angle".

    • WarpedReality Avatar

      I agree that it was quite difficult to understand. It only really made sense to me once I looked up chords in circles on wikipedia. Other that, I like the approach of this kata, to not force me to use a specific algorithm, but instead throw this equation at me and let me decide how I want to solve it.

    • zhangjunyan2580 Avatar

      Resolved. Added sample explanation. Also fixed a typo.

      Thanks for your contribution!

      Issue marked resolved by zhangjunyan2580 4 years ago
  • FArekkusu Avatar

    Constraints: 1 <= X <= 10^3

    Test Cases: 3*10^6 random tests

    3,000,000 tests for 1,000 inputs? Seriously?

    • FArekkusu Avatar

      Ah, X is not limited to integers, so there's more than 1000 possible inputs. Although, I don't see the point in testing those considering the same formula should work both for integral and non-integral X.

      Question marked resolved by FArekkusu 4 years ago
    • Unnamed Avatar

      the same formula

      I think there's no analytical solution, so these are performance tests. I haven't solved it yet thought, so I'm not sure.