Project Euler #144: Investigating multiple reflections of a laser beam.

Sort by

recency

|

6 Discussions

|

  • + 0 comments

    In order to solve this we must find the tangent of line that is reflected. Incident beam and reflected one form the same angle with the normal to the tangent line in point of reflection. Tangent line has the slope -(a/b) * (x / y) where x and y are point of intersection. Having the slope of reflected beam we can easily find its equation and point where it inercects with the ellipse. You sohuld avoid calculating the next intersection point by solving quadratic equation with delta and square roots. It's better to factorize this equation because we have only multiplying and division.

  • + 0 comments

    Anyone got some special test cases I might not be considering? I am getting wrong answer on some questions

  • + 1 comment

    All the test cases except Testcase0 are getting timed out. But i cannot check the testcases. Can any body give me some testcases.

  • + 1 comment

    WA on 4, 6-20. My algorithm is pretty general; not a lot of special cases. I think it might be getting hung up on numerical accuracy. Can anyone suggest some interesting test cases?

  • + 0 comments

    COMMENT