Lets Analyze the Problem

Introduction

Lets break down the problem into manageable parts.

Coordinates

The problem diagram suggests the coordinate's origin (0,0) is in the lower left corner of the box. What coordinate system system should you use?

The Mirror's Coordinates

The problem diagram shows the mirror's center is at (x=90,y=64) with the coordinate's origin (0,0) in the lower left corner of the box.

Finding the coordinates of the mirror giving us something for the laser to aim at. Given a tilt angle of 20°, calculate the top and bottom coordinates of the mirror. Remember, Python's sine and cosine functions use radians. You must convert the angle in degrees to radians. Calculate the coordinates of the top and bottom of the mirror.

image missing

Note: We expect to be tilting the mirror at various angles. Isolate the mirror coordinate code in a function so it can be reused.

The Target's Coordinates

The problem diagram shows the target's center is at (x=0,y=48) with the coordinate's origin (0,0) in the lower left corner of the box. The total length of the target is 10.

The Laser's Coordinates

The problem diagram shows the laser located at at (x=0,y=24) with the coordinate's origin (0,0) in the lower left corner of the box.

Reflected Laser Beam

Given the mirror's end points, calculate where the reflected laser bean hits the box wall. Calculate both the bottom and top reflection. Is the target between top and bottom reflected points? If not, try tilting the mirror.

Reflected Laser Beam

Calculate a laser beam's reflection point coordinates and reflection angle. Remember, the angle of incidence equals the angle of reflection.

image missing

Links

my Python Code Example: line_intersection.py
my Python Code Example: test_line_intersection.py
my Python Code Example: parallel_lines.py
my Python Code Example: angle_between_two_vectors.py
my Python Code Example: two_vector_angle.py

Sympy Line.intersection() method
how to find the intersection of two lines python
Program for Point of Intersection of Two Lines
How to check if two given line segments intersect?
Compute The Intersection Point of Two Lines