Exploring Analyic Geometry with Mathematica® |
|||||
| Home | Contents | Commands | Packages | Explorations | Reference |
| Tour | Lines | Circles | Conics | Analysis | Tangents |
Distance Between Parallel Lines
lnsdst.html
Exploration
Demonstrate that the distance, d, between two parallel lines
is given by
Approach
Create two lines perpendicular to both given lines and passing through the origin. Find the points of intersection between the original lines and the perpendicular lines. Compute the distance between the intersection points, with is the distance between the parallel lines.
Initialize
To initialize Descarta2D, select the input cell bracket and press SHIFT-Enter.
This initialization assumes that the Descarta2D software has been copied into one of the standard directories for AddOns which are on the Mathematica search path, $Path.
<<Descarta2D`
Solution
Create the two given lines.
Clear[A,B,C1,C2];
l1=Line2D[A,B,C1];
l2=Line2D[A,B,C2];
Construct two lines perpendicular to the given lines.
L1=Line2D[Point2D[0,0],l1];
L2=Line2D[Point2D[0,0],l2];
Intersect the lines in pairs to find the intersection points.
p1=Point2D[l1,L1];
p2=Point2D[l2,L2];
Find the distance between the intersection points.
Distance2D[p1,p2] //Simplify
Discussion
Define a new function to compute the distance between two parallel lines. A more general function could be developed that allows parallel lines whose linear coefficients are multiples of each other.
Distance2D[Line2D[A_,B_,C1_],
Line2D[A_,B_,C2_]]:=
Sqrt[(C1-C2)^2/(A^2+B^2)];
Find the distance between the two lines 2x+3y+4=0 and 2x+3y-3=0 using the new function.
Distance2D[Line2D[2,3,4],Line2D[2,3,-3]]