---
title: "Operations on Points and Lines"
canonical: "https://docs.magma-maths.org/v2.30-1/Geometry/FinitePlanes/operation.html"
source: "https://docs.magma-maths.org/v2.30-1/Geometry/FinitePlanes/operation.md"
part: "Geometry"
chapter: "Finite Planes"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Geometry", "source": "https://docs.magma-maths.org/v2.30-1/Geometry/index-geometry.md"}
  - {"title": "Finite Planes", "source": "https://docs.magma-maths.org/v2.30-1/Geometry/FinitePlanes/index-finite-planes.md"}
prev: {"title": "The Connection between Projective and Affine Planes", "source": "https://docs.magma-maths.org/v2.30-1/Geometry/FinitePlanes/projective-affine.md"}
next: {"title": "Arcs", "source": "https://docs.magma-maths.org/v2.30-1/Geometry/FinitePlanes/arc.md"}
intrinsics:
  - {"name": "eq", "signature": "p eq q: PlanePt, PlanePt -> BoolElt"}
  - {"name": "ne", "signature": "p ne q: PlanePt, PlanePt -> BoolElt"}
  - {"name": "eq", "signature": "l eq m: PlaneLn, PlaneLn -> BoolElt"}
  - {"name": "ne", "signature": "l ne m: PlaneLn, PlaneLn -> BoolElt"}
  - {"name": "in", "signature": "p in l: PlanePt, PlaneLn -> BoolElt"}
  - {"name": "notin", "signature": "p notin l: PlanePt, PlaneLn -> BoolElt"}
  - {"name": "subset", "signature": "S subset l: { PlanePt}, PlaneLn -> BoolElt"}
  - {"name": "notsubset", "signature": "S notsubset l: { PlanePt}, PlaneLn -> BoolElt"}
  - {"name": "meet", "signature": "l meet m: PlaneLn, PlaneLn -> PlanePt"}
  - {"name": "Representative", "signature": "Representative(l): PlaneLn -> PlanePt"}
  - {"name": "Rep", "signature": "Rep(l): PlaneLn -> PlanePt"}
  - {"name": "Random", "signature": "Random(l): PlaneLn -> PlanePt"}
  - {"name": "Index", "signature": "Index(P, p): Plane, PlanePt -> RngIntElt"}
  - {"name": "Index", "signature": "Index(P, l): Plane, PlaneLn -> RngIntElt"}
  - {"name": "p[i]", "signature": "p[i]: PlanePt, RngIntElt -> FldFinElt"}
  - {"name": "l[i]", "signature": "l[i]: PlaneLn, RngIntElt -> FldFinElt"}
  - {"name": "Coordinates", "signature": "Coordinates(P, p): Plane, PlanePt -> [ FldFinElt ]"}
  - {"name": "Coordinates", "signature": "Coordinates(P, l): Plane, PlaneLn -> [ FldFinElt ]"}
  - {"name": "ElementToSequence", "signature": "ElementToSequence(p): PlanePt -> [ FldFinElt ]"}
  - {"name": "Eltseq", "signature": "Eltseq(p): PlanePt -> [ FldFinElt ]"}
  - {"name": "ElementToSequence", "signature": "ElementToSequence(l): PlaneLn -> [ FldFinElt ]"}
  - {"name": "Eltseq", "signature": "Eltseq(l): PlaneLn -> [ FldFinElt ]"}
  - {"name": "Set", "signature": "Set(l): PlaneLn -> { PlanePt }"}
  - {"name": "IsCollinear", "signature": "IsCollinear(P, S): Plane, { PlanePt} -> BoolElt, PlaneLn"}
  - {"name": "IsConcurrent", "signature": "IsConcurrent(P, R): Plane, { PlaneLn} -> BoolElt, PlanePt"}
  - {"name": "ContainsQuadrangle", "signature": "ContainsQuadrangle(P, S): Plane, { PlanePt } -> BoolElt"}
  - {"name": "Pencil", "signature": "Pencil(P, p): Plane, PlanePt -> { PlaneLn }"}
  - {"name": "Slope", "signature": "Slope(l): PlaneLn -> FldFinElt"}
  - {"name": "IsParallel", "signature": "IsParallel(P, l, m): Plane, PlaneLn, PlaneLn -> BoolElt"}
  - {"name": "ParallelClass", "signature": "ParallelClass(P, l): Plane, PlaneLn -> { PlaneLn }"}
  - {"name": "ParallelClasses", "signature": "ParallelClasses(P): PlaneAff -> { { PlaneLn } }"}
examples:
  - "ex-b3b9f2"
  - "ex-c0212f"
---

# Operations on Points and Lines

All the usual equality, membership, and subset functions are provided along with a collection of deconstruction functions and others.

## Elementary Operations

<a id="operation-op-eq-planept-planept"></a>
### `p eq q: PlanePt, PlanePt -> BoolElt`

Returns `true` if the points $p$ and $q$ are equal, otherwise `false`.

<a id="operation-op-ne-planept-planept"></a>
### `p ne q: PlanePt, PlanePt -> BoolElt`

Return `true` if the points $p$ and $q$ are not equal, otherwise `false`.

<a id="operation-op-eq-planeln-planeln"></a>
### `l eq m: PlaneLn, PlaneLn -> BoolElt`

Return `true` if the lines $l$ and $m$ are equal, otherwise `false`.

<a id="operation-op-ne-planeln-planeln"></a>
### `l ne m: PlaneLn, PlaneLn -> BoolElt`

Return `true` if the lines $l$ and $m$ are not equal, otherwise `false`.

<a id="operation-op-in-planept-planeln"></a>
### `p in l: PlanePt, PlaneLn -> BoolElt`

Return `true` if point $p$ lies on the line $l$, otherwise `false`.

<a id="operation-op-notin-planept-planeln"></a>
### `p notin l: PlanePt, PlaneLn -> BoolElt`

Return `true` if point $p$ does not lie on the line $l$, otherwise `false`.

<a id="operation-op-subset-planept-planeln"></a>
### `S subset l: { PlanePt}, PlaneLn -> BoolElt`

Given a subset $S$ of the point set of the plane $P$ and a line $l$ of $P$, return `true` if the subset $S$ of points lies on the line $l$, otherwise `false`.

<a id="operation-operation-notsubset-planept-planeln-boolelt"></a>
### `S notsubset l: { PlanePt}, PlaneLn -> BoolElt`

Given a subset $S$ of the point set of the plane $P$ and a line $l$ of $P$, return `true` if the subset $S$ of points does not lie on the line $l$, otherwise `false`.

<a id="operation-op-meet-planeln-planeln"></a>
### `l meet m: PlaneLn, PlaneLn -> PlanePt`

The unique point common to the lines $l$ and $m$.

<a id="function-representative-planeln"></a>
### `Representative(l): PlaneLn -> PlanePt`

<a id="function-rep-planeln"></a>
### `Rep(l): PlaneLn -> PlanePt`

Given a line $l$ of the plane $P$, return a representative point of $P$ which is incident with $l$.

<a id="function-random-planeln"></a>
### `Random(l): PlaneLn -> PlanePt`

Given a line $l$ of the plane $P$, return a random point of $P$ which is incident with $l$.

## Deconstruction Functions

<a id="function-index-plane-planept"></a>
### `Index(P, p): Plane, PlanePt -> RngIntElt`

Given a point $p$ from the point–set $V$ of a plane $P$, return the index of $p$, i.e. the integer $i$ such that $p$ is `V.i`.

<a id="function-index-plane-planeln"></a>
### `Index(P, l): Plane, PlaneLn -> RngIntElt`

Given a line $l$, return the index of $l$ in the plane $P$, i.e. the integer $i$ such that $l$ is $L.i$ (where $L$ is the line–set of $P$).

<a id="literal-literal-p-i-planept-rngintelt-fldfinelt"></a>
### `p[i]: PlanePt, RngIntElt -> FldFinElt`

The $i$-th coordinate of the point $p$, which must be from a classical plane. If $p$ is from a projective plane, then $i$ must satisfy $1 \le i \le 3$; if $p$ is from an affine plane, then $i$ must satisfy $1 \le i \le 2$.

<a id="literal-literal-l-i-planeln-rngintelt-fldfinelt"></a>
### `l[i]: PlaneLn, RngIntElt -> FldFinElt`

The $i$-th coordinate of the line $l$, which must be from a classical plane. The integer $i$ must satisfy $1 \le i \le 3$. Recall that in a classical plane $\left<a:b:c\right>$ (where $a, b, c \in K$) represents the line given by the equation $ax + by + cz = 0$ in a projective plane or $ax + by + c = 0$ in an affine plane.

<a id="function-coordinates-plane-planept"></a>
### `Coordinates(P, p): Plane, PlanePt -> [ FldFinElt ]`

Given a point $p = (a:b:c)$ from a classical projective plane $P$ (or $p = (a,b)$ from a classical affine plane $P$), return the sequence $[a, b, c]$ (or $[a, b]$ in the affine case) of coordinates of $p$.

<a id="function-coordinates-plane-planeln"></a>
### `Coordinates(P, l): Plane, PlaneLn -> [ FldFinElt ]`

Given a line $l = \left<a:b:c\right>$ from a classical plane $P$ (projective or affine), return the sequence $[a, b, c]$ of coordinates of $l$.

<a id="function-elementtosequence-planept"></a>
### `ElementToSequence(p): PlanePt -> [ FldFinElt ]`

<a id="function-eltseq-planept"></a>
### `Eltseq(p): PlanePt -> [ FldFinElt ]`

Given a point $p = (a:b:c)$ from a classical projective plane $P$ (or $p = (a,b)$ from a classical affine plane $P$), return the sequence $[a, b, c]$ (or $[a, b]$ in the affine case) of coordinates of $p$.

<a id="function-elementtosequence-planeln"></a>
### `ElementToSequence(l): PlaneLn -> [ FldFinElt ]`

<a id="function-eltseq-planeln"></a>
### `Eltseq(l): PlaneLn -> [ FldFinElt ]`

Given a line $l = \left<a:b:c\right>$ from a classical plane $P$ (projective or affine), return the sequence $[a, b, c]$ of coordinates of $l$.

<a id="function-set-planeln"></a>
### `Set(l): PlaneLn -> { PlanePt }`

The set of points contained in the line $l$.

<a id="example-ex-b3b9f2"></a>
### `Example: Deconstructing Points and Lines (ex-b3b9f2)`

The following example illustrates the use of some of the elementary and deconstruction functions on lines and points discussed in the previous two subsections.

```magma
> K<w> := GF(4);
> P, V, L := FiniteProjectivePlane(K);
```

Create the line $x + z = 0$:

```magma
> l := L![1, 0, 1];
> l;
< 1 : 0 : 1 >
```

Look at the points on the line $l$:

```magma
> Set(l);
{  ( 0 : 1 : 0 ), ( 1 : w^2 : 1 ), ( 1 : 0 : 1 ),
   ( 1 : w : 1 ), ( 1 : 1 : 1) }
```

Get the coordinates of the line $l$:

```magma
> Coordinates(P, l);
[ 1, 0, 1 ]
> l[1];
1
```

Find the index of the line $l$ in the line–set $L$ of $P$, and check it:

```magma
> Index(P, l);
8
> l eq L.8;
true
```

Test if a point is on the line $l$:

```magma
> V![1, 0, 1] in l;
true
```

Test a set of points for containment in $l$:

```magma
> S := {V.1, V.2};
> S;
{  ( 1 : 0 : 0 ), ( 0 : 1 : 0 ) }
> S subset l;
false
```

Create the line containing the points in $S$:

```magma
> l2 := L!S;
> l2;
< 0 : 0 : 1 >
> S subset l2;
true
```

And finally, find the point common to the lines $l$ and $l2$:

```magma
> p := l meet l2;
> p;
( 0 : 1 : 0 )
> p[3];
0
```

## Other Point and Line Functions

<a id="function-iscollinear-plane-planept"></a>
### `IsCollinear(P, S): Plane, { PlanePt} -> BoolElt, PlaneLn`

Return `true` if the set $S$ of points of the plane $P$ are collinear, otherwise `false`. If the points are collinear, the line which they define is also returned.

<a id="function-isconcurrent-plane-planeln"></a>
### `IsConcurrent(P, R): Plane, { PlaneLn} -> BoolElt, PlanePt`

Return `true` if the set $R$ of lines of the plane $P$ are concurrent, otherwise `false`. If the lines are concurrent, their common point is returned as a second value.

<a id="function-containsquadrangle-plane-planept"></a>
### `ContainsQuadrangle(P, S): Plane, { PlanePt } -> BoolElt`

Return `true` if the set $S$ of points of a plane $P$ contains a quadrangle.

<a id="function-pencil-plane-planept"></a>
### `Pencil(P, p): Plane, PlanePt -> { PlaneLn }`

The pencil of lines passing through the point $p$ in the plane $P$.

<a id="function-slope-planeln"></a>
### `Slope(l): PlaneLn -> FldFinElt`

The slope of the line $l$ of a classical affine plane $P$.

<a id="function-isparallel-plane-planeln-planeln"></a>
### `IsParallel(P, l, m): Plane, PlaneLn, PlaneLn -> BoolElt`

Return `true` if the line $l$ is parallel to the line $m$ in the affine plane $P$.

<a id="function-parallelclass-plane-planeln"></a>
### `ParallelClass(P, l): Plane, PlaneLn -> { PlaneLn }`

The parallel class containing the line $l$ of an affine plane $P$.

<a id="function-parallelclasses-planeaff"></a>
### `ParallelClasses(P): PlaneAff -> { { PlaneLn } }`

The partition into parallel classes of the lines of the affine plane $P$.

<a id="example-ex-c0212f"></a>
### `Example: Point and Line Functions in AG(2,3) (ex-c0212f)`

We use the affine plane $AG_2(3)$ to demonstrate some of the above functions.

```magma
> A, V, L := FiniteAffinePlane(3);
```

Create the line $y = 2x + 1$ in A, and check its slope:

```magma
> l := L![2, 1];
> l;
< 1 : 1 : 2 >
> Slope(l);
2
```

Find the lines parallel to $l$:

```magma
> ParallelClass(l);
{
    < 1 : 1 : 0 >,
    < 1 : 1 : 1 >,
    < 1 : 1 : 2 >
}
> [Slope(m): m in ParallelClass(l)];
[ 2, 2, 2 ]
```

Get the pencil of lines through a point of $l$:

```magma
> p := Rep(l);
> p;
( 1, 0 )
> Pencil(A, p);
{
    < 1 : 0 : 2 >,
    < 1 : 1 : 2 >,
    < 1 : 2 : 2 >,
    < 0 : 1 : 0 >
}
```
