Finding a point of intersection of two objects in the plane

### 26.5.6 Finding a point of intersection of two objects in the plane

See Section 27.3.3 for single points of intersection of objects in space.

The single_inter or line_inter command finds an intersection point of two geometric objects.

- 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).

circle(0,1),line(-1,i),single_inter(circle(0,1),line(-1,i))

which is the point (−1,0).

circle(0,1),line(-1,i),single_inter(circle(0,1),line(-1,i),[-1])

which is the point (0,1). Similarly, since this second point of intersection is closest to (0,1/2), entering:

single_inter(circle(0,1),line(-1,i),i/2)

also draws the second point.