# Orthogonal projection in space: projection

### 14.14.8 Orthogonal projection in space: projection

See Section 13.15.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.

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

  ⎡
  ⎢
  ⎢
  ⎣

  1
  3

  ,

  1
  3

  ,

  1
  3

  ⎤
  ⎥
  ⎥
  ⎦

  which is the projection of (0,0,1) onto the line.
- Input:
  coordinates(projection(plane(point(1,0,0),point(0,0,0),point(1,1,1)),point(0,0,1)))
  Output:

  ⎡
  ⎢
  ⎢
  ⎣

  0,

  1
  2

  ,

  1
  2

  ⎤
  ⎥
  ⎥
  ⎦

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