Activity 1

prepared by Ken Levasseur

Mathematica Versions of the code

dist[a1_, b1_, a2_, 
        b2_] := (Sqrt[(((a1 - a2))^2) + (((b1 - b2))^2)])

dist[-3, 2, 5, 1]

Solve[dist[x, y, -3, 2] == dist[x, y, 5, 1], y]

Solve[dist[x, y, -3, 2] + dist[x, y, 5, 1] == 9, 
      y]

Comments/Extensions

Here is how to plot an output from Solve.   First shut off the message that comes up when a complex solution occurs in the plotting.

Off[Plot::plnr]

Solutions are lists of rules and there are two solutions to this equation.

solution  =  
      Solve[dist[x, y, -3, 2] + dist[x, y, 5, 1] == 9, 
        y]

The plot range, -5 ≤ x ≤ 8 took some adjusting.   The AspectRatio option forces a uniform scale on the plot.  Otherwise the plot is distorted.

Plot[Evaluate[y /. solution], {x, -5, 8}, 
      Epilog -> {Point[{-3, 2}], Point[{5, 1}]}, 
      AspectRatio -> Automatic, PlotPoints -> 200]