Calculating supplementary angles from intersecting line with direction and line with gradient

22 Views Asked by At

Example image where I'd be interested in finding angles a and bA simulated robotic agent is travelling in an known direction heading relative to north as it hits (at for example, 30 degrees) a straight wall (speeed doesn't matter), of which two points on this wall/line are known (i.e. (-3, 7) and (8, 5)). I am wanting to calculate the supplementary angles that are created as the agent makes contact with the wall when moving in its heading direction.

I haven't really done this kind of maths in ages, I'm sure its relatively straight forward, but does anyone know how to perform these sorts of calculation?

1

There are 1 best solutions below

0
On

The angle $\theta_\text{wall}$ that the wall makes relative to north will be given by $$ \tan (\theta_\text{wall}) = \frac{\Delta x}{\Delta y} $$ where $\Delta x$ and $\Delta y$ are the changes in $x$ and $y$ coordinates between two known points on the wall. (Assuming the $y$-axis points to the north and the $x$-axis points east.) Once you have this angle, the angle between the robot's path and the line of the wall will just be the difference between these angles: $\theta_\text{robot} - \theta_\text{wall}$.