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

  • + 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.