13.6.7 Finding the points of intersection of two geometric objects in the plane: inter
See Section 14.4.4 for points of intersection of objects
in space.
The inter command finds the intersection of two geometric
objects in the plane.
inter takes two mandatory arguments and one
optional argument.
obj1, obj2, two geometric objects.
Optionally, P, a point.
inter(obj1,obj2 ⟨ P⟩)
returns a list of points of intersection of obj1 and obj2.
With the argument P, the command returns the point
of intersection closest to P.
Examples.
Input:
inter(circle(0,1),line(1,i))
Output:
which are the points at (1,0) and (0,1).
To get just one of the points, use the usual list indices. Input:
inter(circle(0,1),line(1,i))[0]
Output:
just one of the points.
To get the point closest to (0,1/2): Input: