Closest Point Finder
Run the Closest Point Finder MicroSim Fullscreen
Edit the Closest Point Finder MicroSim with the p5.js editor
About This MicroSim
This interactive visualization helps students explore optimization problems involving finding the minimum distance from a fixed point to a curve. This is a classic calculus application that connects derivatives, perpendicularity, and optimization.
Key Concepts Demonstrated
- Distance Function: As you move along a curve, the distance to a fixed target point varies continuously
- Minimum Distance Condition: At the closest point, the line connecting the curve point to the target is perpendicular to the tangent line
- Why Perpendicularity?: The derivative of distance equals zero when the connecting line is perpendicular to the curve's direction of travel
How to Use
- Drag the red target point anywhere on the coordinate plane
- Use the slider to move a point along the selected curve
- Click "Find Minimum" to automatically locate the closest point
- Toggle "Show Tangent & Perpendicular" to see the perpendicularity verification (purple tangent line + slope calculations)
- Select different curves to explore various optimization scenarios
Available Curves
- y = x^2 (Parabola) - The classic example
- y = x^3 (Cubic) - Asymmetric curve with inflection point
- x^2 + y^2 = 4 (Circle) - Parametric curve where closest point is along the radius
- y = sin(x) (Sine wave) - Periodic curve with multiple local minima
The Distance Trace Panel
The small graph in the lower right shows how distance varies as you move along the curve. Notice: - The minimum appears as the lowest point on this trace - Multiple local minima may exist for some curves and target positions - The green dot shows your current position; orange shows the minimum
Iframe Embed Code
You can include this MicroSim on your website using the following iframe:
1 | |
Lesson Plan
Learning Objectives
By the end of this activity, students will be able to:
- Compare distances from various points on a curve to a fixed target point
- Explain why the minimum distance occurs when the connecting line is perpendicular to the tangent
- Connect the perpendicularity condition to the derivative being zero
- Apply this concept to solve optimization problems involving distance minimization
Suggested Activities
Activity 1: Exploration (10 minutes)
- Place the target point at (1, 3)
- Use the parabola y = x^2
- Manually slide along the curve and observe the distance values
- Predict where the minimum will be, then click "Find Minimum"
- Enable "Show Tangent & Perpendicular" and verify the perpendicularity
Activity 2: Circle Investigation (5 minutes)
- Switch to the circle x^2 + y^2 = 4
- Place the target at (3, 0) - outside the circle
- Find the minimum distance
- Observe: the closest point lies on the line from center to target
- Discuss: why does this make geometric sense?
Activity 3: Multiple Minima (10 minutes)
- Use y = sin(x)
- Place the target at (0, 2)
- Observe the distance trace - multiple valleys indicate local minima
- Move the target and observe how the trace changes
- Discuss: when does a global minimum become a local minimum?
Assessment Questions
- Why is the connecting line perpendicular to the tangent at the minimum distance point?
- For the parabola y = x^2 with target point (0, a) where a > 0, describe how the minimum distance point changes as 'a' increases.
- Can you think of a real-world scenario where finding the closest point on a curve is important?
Mathematical Background
At the minimum distance point, if we parameterize the curve as (x(t), y(t)), the distance function is:
where (x_0, y_0) is the target point. Setting D'(t) = 0 leads to:
This equation states that the vector from the curve point to the target is perpendicular to the tangent vector (x'(t), y'(t)).