.The future: I\(I love this cartoon)
Tag Archives: computers
One of the actions is to find the points of intersection of a straight line with a circle. Here is a gif showing the result:
The algebra needed to solve the two simultaneous equations is straightforward, but a pain in the butt to get right and code up, so I thought “Why not solve the equations for the very simple case of the circle centered at the origin and the line vertical, at the same distance (a) from the centre of the circle
Then it is a simple matter of rotating the two points (a,b) and (a,-b) about the origin, through the angle made by the original line to the vertical, and then translating the circle back to its original position, the translated points are then the desired points of intersection.
The same routine can be used for the intersection of two circles, with a little bit of prior calculation.