Excellent, thank you! So I created a general function for distance, and then plotted that, and it looks correct. However, now I'm trying to solve for the roots of the derivative of that distance function to find where exactly the tangents are 0 (so I can find the minimum), but it's stuck...