### 26.12.4 Coordinates of a point, vector or line in the plane

See Section 27.10.4 for coordinates in 3D geometry.

The coordinates finds the coordinates of a point or two points that determine a line.

- coordinates takes X, either a point, a sequence or list of points, or a line.
- coordinates(X) returns:
  - a list consisting of the abscissa and ordinate of X, if X is a point or a vector, or a sequence or list of such lists, if X is a sequence or list of points.
  - a list of two points on the line X, in the order determined by the direction of the line, if X is a line.

#### Examples

coordinates(1+2*i)

or:

coordinates(point(1+2*i))

or:

coordinates(vector(1+2*i))

| ⎡ ⎣ | 1,2 | ⎤ ⎦

coordinates(point(1+2*i)-point(i))

or:

coordinates(vector(i,1+2*i))

or:

coordinates(vector(point(i),point(1+2*i)))

or:

coordinates(vector([0,1],[1,2]))

| ⎡ ⎣ | 1,1 | ⎤ ⎦

d:=line(-1+i,1+2*i)

or:

d:=line(point(-1,1),point(1,2))

then:

coordinates(d)

| ⎡ ⎣ | −1+i,1+2 i | ⎤ ⎦

coordinates(line(y=x/2+3/2))

⎡
⎢
⎢
⎣

3 i
2

,1+2 i

⎤
⎥
⎥
⎦

coordinates(line(x-2*y+3=0))

⎡
⎢
⎢
⎣

3 i
2

,

−4+i
2

⎤
⎥
⎥
⎦

coordinates(i,1+2*i)

or:

coordinates(point(i),point(1+2*i))

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

Note that if the argument is a list of real numbers, it is interpreted as a list of points on the real axis.

coordinates([1,2])

⎡
⎢
⎣

1 | 0
2 | 0

⎤
⎥
⎦