### 27.12.8 Orthogonal projection in space

See Section 26.14.8 for projections in the plane.

The projection command creates a projection.

- projection takes one mandatory argument and one optional argument:
  - O, a geometrix object.
  - Optionally, P, a point.
- projection(O) returns a new command which projects points onto O.
- projection(O,P) returns and draws the projection of P onto O.

#### Examples

P:=point(0,0,1); p1:=projection(line(point(0,0,0),point(1,1,1))); coordinates(p1(P))

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

which is the projection of (0,0,1) onto the line.

coordinates(projection(plane(point(1,0,0),point(0,0,0),point(1,1,1)),point(0,0,1)))

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

which is the projection of the point (0,0,1) onto the plane.