# Action of ${\operatorname{PSL}}_2({\mathbb{R}})$ on the Upper Half Plane

## `g * z: GrpPSL2Elt, SpcHypElt -> SpcHypElt`

## `g * z: GrpPSL2Elt, [SpcHypElt] -> [SpcHypElt]`

## `g * z: GrpPSL2Elt, SetCspElt -> SetCspElt`

## `g * z: RngIntElt, SpcHypElt -> SpcHypElt`

## `g * z: RngIntElt, [SpcHypElt] -> [SpcHypElt]`

## `g * z: RngIntElt, SetCspElt -> SetCspElt`

For $z$ of type `SpcHypElt, SetCspElt ` or `[SpcHypElt]`, and when $g$ is an element of a projective linear group, returns the image of $z$ under the action of $g$. The type of the image is the same as the type of $z$. If $g$ is a positive integer, returns return $az$, which his is equivalent to acting on $z$ with the matrix $\begin{pmatrix}a & 0\\ 0 & 1\end{pmatrix}\in {\operatorname{PGL}}_2({\mathbb{R}})$.

## `FixedPoints(g, H): GrpPSL2Elt, SpcHyp -> SeqEnum`

Returns a sequence of points in $H$ fixed by the action of $g$.

## `IsEquivalent(G, a, b): GrpPSL2, SpcHypElt, SpcHypElt -> BoolElt, GrpPSL2Elt`

If points $a,b$ in the upper half plane are equivalent under the action of the group $G$, returns `true`, and the matrix $g$ in $G$ such that $g\cdot a = b$. Otherwise returns `false` and the identity.

## `EquivalentPoint(x): SpcHypElt -> SpcHypElt, GrpPSL2Elt`

For the point x in the upper half plane, returns a point z in the region with $-1/2 < z \leq 1/2$ and $|z| \geq 1$, and a matrix $g$ in ${\operatorname{PSL}}_2({\mathbb{Z}})$ with g*x = z

## `Stabilizer(a, G): SpcHypElt, GrpPSL2 -> GrpPSL2Elt`

Returns a generator of the subgroup of $G$ stabilizing $a$.

## `FixedArc(g, H): GrpPSL2Elt, SpcHyp -> SeqEnum`

If $g$ is an element of ${\operatorname{PSL}}_2({\mathbb{Z}})$ which is an involution, this returns the end points in the real line of the arc fixed by $g$, with mid point of the arc also fixed by $g$. Note that for any point $b$, the arc from $b$ to $g\cdot b$ is fixed by $g$.

## Arithmetic

### `z + a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z + a: SpcHypElt, FldRatElt -> SpcHypElt`

### `z - a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z - a: SpcHypElt, FldRatElt -> SpcHypElt`

For any integer $a$, and element $z$ in the upper half plane, this returns the element $z + a$ in the same copy of the upper half plane.

### `a * z: RngElt, SpcHypElt -> SpcHypElt`

### `z * a: SpcHypElt, RngElt -> SpcHypElt`

### `a * z: RngIntElt, SetCspElt -> SetCspElt`

### `a * z: FldRatElt, SetCspElt -> SetCspElt`

### `a * seq: RngElt, [SpcHypElt] -> [SpcHypElt]`

### `a * z: RngIntElt, [SetCspElt] -> [SetCspElt]`

### `a * z: FldRatElt, [SetCspElt] -> [SetCspElt]`

### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

### `z / a: SpcHypElt, RngIntElt -> SpcHypElt`

Given an element z (or a sequence of elements) in the upper half plane, and a positive rational number $a$, this returns the product (or products) in the same copy of the upper half plane.

## Distances, Angles and Geodesics

### `Distance(z, w): SpcHypElt, SpcHypElt -> FldReElt`

```magma
Precision: RngIntElt                    Default: 
```

Returns the hyperbolic distance between $z$ and $w$.

### `TangentAngle(x, y): SpcHypElt, SpcHypElt -> FldReElt`

```magma
Precision: RngIntElt                    Default: 
```

Returns the angle of the tangent at $x$ of the geodescic from $x$ to $y$, with given precision.

### `Angle(e1, e2): [SpcHypElt], [SpcHypElt] -> FldReElt`

```magma
Precision: RngIntElt                    Default: 
```

Given two sequences $e_1 = [z_1,z_2]$ and $e_2 = [z_1,z_3]$, where $z1, z2, z3$ are elements of the upper half plane, this returns the angle between the geodesics at $z_1$.

### `ExtendGeodesic([z1,z2], H): [SpcHypElt], SpcHyp -> [SpcHypElt]`

Given elements $z1, z2$ in the upper half plane $H$, this extends the geodesic between $z1$ and $z2$ to a semicircle with endpoints on the real line, and returns the two real endpoints as elements of $H$.

### `GeodesicsIntersection(x1, x2): [SpcHypElt], [SpcHypElt]) -> SeqEnum`

### `GeodesicsIntersection(x1, x2): [SetCspElt], [SetCspElt]) -> SeqEnum`

The intersection in the upper half plane of the two geodesics whose endpoints are given by the sequences $x_1$ and $x_2$. If the geodesics intersect along a line, the empty sequence is returned.
