# Unit Disc

Let $D$ denote the Poincaré unit disc,

$$
D=\{z \in {\mathbb{C}}:|z|<1\}
$$

equipped with the hyperbolic metric

$$
d(z,w) = \log \left({|1-z\bar{w}| + |z-w| \over |1-z\bar{w}| - |z-w|}\right).
$$

We mimic the existing functionality for working with the upper half-plane (see Chapter [Congruence Subgroups of ${\operatorname{PSL}}_2({\mathbb{R}})$](../CongruenceSubgroupsOfPSL2R/index-congruence-subgroups-of-psl2-r.md#chapgrppsl2)) to compute in a similar way with the geometry of the unit disc, including computation of angles, intersections, areas, and so on.

## Creation

### `UnitDisc() -> SpcHyd`

```magma
Center   : RngElt                    Default: (9/10)i
Precision: RngElt                    Default: 0
```

The hyperbolic unit disc, mapped conformally to the upper half-plane by mapping $0$ in $D$ to `Center`, with given `Precision`.

## Basic Operations

### `D ! x: SpcHyd, . -> SeqEnum`

Coerces $x$ into $D$, if possible.

### `x eq y: SpcHydElt, SpcHydElt -> BoolElt`

Returns `true` if and only if $x=y$.

### `a * x: RngElt, SpcHydElt -> RngElt`

### `x * a: SpcHydElt, RngElt -> RngElt`

Returns $a \cdot x$.

### `x + y: SpcHydElt, RngElt -> RngElt`

### `y + x: RngElt, SpcHydElt -> RngElt`

### `x + y: SpcHydElt, SpcHydElt -> RngElt`

Returns $x+y$.

### `x - y: SpcHydElt, RngElt -> RngElt`

### `x - y: RngElt, SpcHydElt -> RngElt`

### `x - y: SpcHydElt, SpcHydElt -> RngElt`

Returns $x-y$.

### `x / a: SpcHydElt, RngElt -> RngElt`

Returns $(1/a)\cdot x$.

## Access Operations

### `IsExact(z): SpcHydElt -> BoolElt, .`

Returns `true` (and the exact value of $z$) if and only if $z$ is exact.

### `ExactValue(z): SpcHydElt -> .`

Returns the exact value of $z$; if it does not exist, returns an error.

### `ComplexValue(z): SpcHydElt -> FldComElt`

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

Returns the complex value $z$, with given precision.

### `Im(z): SpcHydElt -> FldReElt`

### `Imaginary(z): SpcHydElt -> FldReElt`

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

Returns the imaginary part of $z$, with given precision.

### `Re(z): SpcHydElt -> FldReElt`

### `Real(z): SpcHydElt -> FldReElt`

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

Returns the real part of $z$, with given precision.

### `Argument(z): SpcHydElt -> FldReElt`

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

Returns the argument of $z$, with given precision.

### `Abs(z): SpcHydElt -> FldReElt`

### `AbsoluteValue(z): SpcHydElt -> FldReElt`

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

Returns the absolute value of $z$, with given precision.

### `Example: Unit Disc Basics (ex-98d2b2)`

In this example, we exhibit basic functions for the unit disc.

```magma
> D := UnitDisc();
> D;
Hyperbolic unit disc
> CC<I> := ComplexField();
> w := D ! ((1+I)/2);
> w;
0.500000000000000000000000000000 + 0.500000000000000000000000000000*I
> Re(w), Abs(w);
0.500000000000000000000000000000 0.707106781186547524400844362105

```

Note that since $D$ does not form a ring, when binary operations are performed, we return elements according to the base ring in which they belong; if desired, they can be coerced back into $D$.

```magma
> z := D ! 0;
> z;
0
> IsExact(z);
true 0
> ComplexValue(z : Precision := 100);
0.00000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000
> 2*z;
0
> Type($1);
FldRatElt
> D!(z+w) eq w;
true

```

## Distance and Angles

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

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

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

### `Geodesic(z, w): SpcHydElt, SpcHydElt -> RngElt, RngElt`

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

Returns the center and radius of the geodesic containing $z$ and $w$, with given precision.

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

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

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

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

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

Given two sequences $e_1 = [z_1,z_2]$ and $e_2 = [z_1,z_3]$, returns the angle between the geodesics at $z_1$.

### `ArithmeticVolume(P): [SpcHydElt] -> FldReElt`

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

The volume of the convex region specified the sequence of elements of the unit disc. The elements must be specified in counterclockwise order by their arguments. The volume is normalized “arithmetic” volume, so the “usual” volume is divided by $2\pi$; this gives an ideal triangle volume $1/2$.

### `Example: Unit Disc Angle (ex-f69b8f)`

In this example, we compute geodesics in the unit disc.

```magma
> D := UnitDisc();
> CC<I> := ComplexField();
> z0 := D!0;
> z1 := D!(1/2*I);
> z2 := D!(1/2);
> Distance(z0,z1);
1.09861228866810969139524523692
> Geodesic(z0,z1);
Infty 0.000000000000000000000000000000
> Geodesic(z1,z2);
1.25000000000000000000000000000 + 1.25000000000000000000000000000*I
1.45773797371132511771853821939
> TangentAngle(z0,z1);
1.57079632679489661923132169164
> TangentAngle(z1,z2);
-1.03037682652431246378774332703
> Angle([z1,z2],[z1,z0]);
2.60117315331920908301906501867
> ArithmeticVolume([D | 1/2+1/2*I, -1/2+1/2*I, -1/2-1/2*I, 1/2-1/2*I]);
0.590334470601733096701604304899

```

## Structural Operations

### `T * x: GrpPSL2Elt, SpcHydElt -> SpcHydElt`

Returns $T(x)$, using the identification of the unit disc with the upper half-plane.

### `Center(D): SpcHyd -> RngElt`

Returns the element in the upper half-plane which maps to 0 in D.

### `DiscToPlane(H, z): SpcHyp, SpcHydElt -> SpcHypElt`

Maps $z$ in a unit disc to ${\mathbb{H}}$.

### `PlaneToDisc(D, z): SpcHyd, SpcHypElt -> SpcHydElt`

Maps $z$ in an upper half-plane to $D$.

### `Matrix(g, D): GrpPSL2Elt, SpcHyd -> AlgMatElt`

Returns the matrix representation of $g$ acting on the unit disc $D$.

### `FixedPoints(g, D): GrpPSL2Elt, SpcHyd -> SeqEnum`

Returns the fixed points of g acting on D.

### `IsometricCircle(g): GrpPSL2Elt -> RngElt, RngElt`

### `IsometricCircle(g, H): GrpPSL2Elt, SpcHyp -> RngElt, RngElt`

Returns the center and radius of the set of points in the upper half-plane $H$ where $g$ acts as a Euclidean isometry.

### `IsometricCircle(g, D): GrpPSL2Elt, SpcHyd -> RngElt, RngElt`

Returns the center and radius of the set of points in the unit disc $D$ where $g$ acts as a Euclidean isometry.

### `GeodesicsIntersection(x1, x2): [SpcHydElt], [SpcHydElt]) -> .`

Returns the intersection in the unit disc of the two geodesics $x_1$, $x_2$, where $x$ and $y$ are specified by their end points. If more than one intersection exists, returns a sequence.

### `BoundaryIntersection(x): [SpcHydElt] -> [FldComElt]`

Computes the intersection of the geodesic $x$ with the boundary of the unit disc.

### `Example: Unit Disc Practice2 (ex-b11ad6)`

In this example, we illustrate the use of the structural operations on the unit disc. We begin by declaring a Fuchsian group over the totally real subfield $F={\mathbb{Q}}(\zeta_9)^+$ of ${\mathbb{Q}}(\zeta_9)$.

```magma
> K<z> := CyclotomicField(9);
> F := sub<K | z+1/z >;
> b := F! (z+1/z);
> A<alpha,beta> := QuaternionAlgebra<F | -3, -b>;
> G := FuchsianGroup(A);
> O := BaseRing(G);
> A<alpha,beta> := Algebra(O);

```

Next, we compute the fixed point of the element $g=(1+\alpha)/2$.

```magma
> g := G!((1+alpha)/2);
> H := UpperHalfPlane();
> FixedPoints(g, H);
[
    root(-1)
]
> Matrix(g);
[0.5000000000000000000000000000000000000000000000000000000000000000000000000000
    000000000000000000000000 0.866025403784438646763723170752936183471402626905
    1903140279034897259665084544000185405730933786242878]
[-0.866025403784438646763723170752936183471402626905190314027903489725966508454
    4000185405730933786242878 0.50000000000000000000000000000000000000000000000
    00000000000000000000000000000000000000000000000000000]
> g*H.1;
root(-1);

```

The fixed point is at $z=i$. Next, we compute the isometric circle $C(g)$ of $g$,

$$
C(g)=\{z \in {\mathbb{C}}: |g(z)|=|z| \}.
$$

(See also the next section on fundamental domains.)

```magma
> cH, rH := IsometricCircle(g);
> cH;
0.57735026918962576450914878050195745564760175127012687601860232648397767230293
33456937153955857495252
> rH;
1.15470053837925152901829756100391491129520350254025375203720465296795534460586
6691387430791171499050

```

The circle $C(g)$ has radius $r_H=1.154\dots$ and center $c_H=0.577\dots$. We verify that $g$ acts by a Euclidean isometry at the point $c_H+r_H i \in C(g)$.

```magma
> CC<I> := ComplexField();
> Abs(Matrix(g)[2,1]*(cH+rH*I)+Matrix(g)[2,2]);
1.00000000000000000000000000000

```

We now repeat these same steps, with $g$ acting on the unit disc $D$.

```magma
> D := UnitDisc(: Center := 9/10*H.1);
> Matrix(g, D);
[0.5000000000000000000000000000000000000000000000000000000000000000000000000000
    000000000000000000000000 + 0.8708366560276855281346327439238178790538869671
    932875211895468244836121536336192488985662869809493679*$.1
    -0.091413792621690746047281890246448583363214116792146568962386184205317861
    46329352761052320334348050449*$.1]
[0.0914137926216907460472818902464485833632141167921465689623861842053178614632
    9352761052320334348050449*$.1 0.5000000000000000000000000000000000000000000
    000000000000000000000000000000000000000000000000000000000 -
    0.8708366560276855281346327439238178790538869671932875211895468244836121536
    336192488985662869809493679*$.1]
> cD, rD := IsometricCircle(g, D);
> Abs(Matrix(g, D)[2,1]*PlaneToDisc(D, H!(cH+rH*I))+Matrix(g, D)[2,2]);
1.00000000000000000000000000000

```
