13.6.6 Finding a point of intersection of two objects in the plane: single_inter line_inter
See Section 14.4.3 for single points of
intersection of objects in space.
The single_inter command
finds an intersection point of two geometric objects.
line_inter is a synonym for single_inter
-
single_inter takes two mandatory arguments and one
optional argument.
-
obj1, obj2, two geometric objects.
- Optionally, pt, a point or list of points.
line_inter(obj1,obj2 ⟨pt⟩)
returns one of the points of
intersection of obj1 and obj2.
If pt is a single point, then the command returns the point
of intersection closest to pt.
If pt is a list of points, then the command tries to return
a point not in pt.
Example.
The command circle(0,1) creates the unit circle and
line(-1,i) creates a line, these two objects intersect at the
points (−1,0) and (0,1).
Input:
single_inter(circle(0,1),line(-1,i))
Output:
which is the point (−1,0).
Input:
single_inter(circle(0,1),line(-1,i),[-1])
Output:
which is the point (0,1). Similarly, since this second
point of intersection is closest to (0,1/2), entering:
Input:
single_inter(circle(0,1),line(-1,i),i/2)
also draws the second point.