Finding an intersection point of two objects in space

### 27.3.3 Finding an intersection point of two objects in space

See Section 26.5.6 for single points of intersection of objects in the plane.

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.

#### Examples

A:=single_inter(plane(point(0,1,1),point(1,0,1),point(1,1,0)), line(point(0,0,0),point(1,1,1))):; coordinates(A)

| ⎡ ⎢ ⎢ ⎣ |
2
3
| , |
2
3
| , |
2
3
| ⎤ ⎥ ⎥ ⎦

B:=single_inter(sphere(point(0,0,0),1),line(point(0,0,0),point(1,1,1))):; coordinates(B)

| ⎡ ⎢ ⎢ ⎣ |
√ |
3
3
| , |
√ |
3
3
| , |
√ |
3
3
| ⎤ ⎥ ⎥ ⎦

B1:=single_inter(sphere(point(0,0,0),1),line(point(0,0,0),point(1,1,1)),point(-1,0,0)):; coordinates(B1)

| ⎡ ⎢ ⎢ ⎣ | − |
√ |
3
3
| ,− |
√ |
3
3
| ,− |
√ |
3
3
| ⎤ ⎥ ⎥ ⎦

C:=single_inter(sphere(point(0,0,0),1),line(point(1,0,0),point(1,1,1))):; coordinates(C)

| ⎡ ⎣ | 1,0,0 | ⎤ ⎦

C1:=single_inter(sphere(point(0,0,0),1),line(point(1,0,0),point(1,1,1)),[point(1,0,0)]):; coordinates(C1)

| ⎡ ⎢ ⎢ ⎣ |
1
3
| , |
2
3
| , |
2
3
| ⎤ ⎥ ⎥ ⎦