Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
674 changes: 674 additions & 0 deletions LICENCE.md

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ https://github.com/user-attachments/assets/cd1cf6c3-3550-4b40-a5ad-6ffeced9316c

### Gnomonic projection

To run the 2D ./gradlew run2D --args='gnomonic'
model, run the command
To run the 2D Gnomonic projection model, run the command

```bash
./gradlew run2D --args='gnomonic'
Expand All @@ -104,34 +103,34 @@ https://github.com/user-attachments/assets/23b0f337-2429-4373-aad7-e0cc986aa4b7

### 0. Project Setup

- A . [How to Run the Project](docs/running-the-project.md)
- B . [How to contribute](.github/CONTRIBUTING.md)
- C . [What for?](docs/what_for.md)
- A. [How to Run the Project](docs/running-the-project.md)
- B. [How to contribute](.github/CONTRIBUTING.md)
- C. [What for?](docs/what_for.md)

### I. Foundations in Hyperbolic Geometry

- A . [Introduction](docs/I/introduction.md)
- B . [Poincaré Disk Model](docs/I/basic-mathematics-in-the-poincare-disk-model.md)
- C . [Isometries](docs/I/isometries.md)
- A. [Introduction](docs/I/introduction.md)
- B. [Poincaré Disk Model](docs/I/basic-mathematics-in-the-poincare-disk-model.md)
- C. [Isometries](docs/I/isometries.md)

### II. Tessellations

- A . [Introduction to Tessellation](docs/II/introduction_to_tesslation.md)
- B . [Coordinate System](docs/II/coordinates_system.md)
- C . [Implementation](docs/II/implementation.md)
- A. [Introduction to Tessellation](docs/II/introduction_to_tesslation.md)
- B. [Coordinate System](docs/II/coordinates_system.md)
- C. [Implementation](docs/II/implementation.md)

### III. 3D Rendering

- A . Ray-Caster Maze (WIP)
- B . [Visual effects](docs/III/3d-effects.md)
- A. Ray-Caster Maze (WIP)
- B. [Visual effects](docs/III/3d-effects.md)

### IV. In-Depth Explorations

- A . [Other Models](docs/IV/other_models.md)
- A. [Other Models](docs/IV/other_models.md)

## Licence

See all about our license [here](/LICENCE)
See all about our license [here](LICENCE.md)

![GPL3](https://upload.wikimedia.org/wikipedia/commons/c/cb/GPLv3_Logo_filled.png)

Expand Down
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 22 additions & 12 deletions docs/I/basic-mathematics-in-the-poincare-disk-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

### hyperboloid

In hyperbolic geometry, one elegant way to visualize non-Euclidean space is through the Poincaré disk model. This model can be derived from a higher-dimensional perspective by considering a [two-sheeted hyperboloid](https://en.wikipedia.org/wiki/Hyperboloid#Hyperboloid_of_two_sheets). By introducing an extra dimension, we can construct the [hyperboloid](https://en.wikipedia.org/wiki/Hyperboloid) where its equation typically takes the form : $$x^2 + y^2 - z^2 = -1$$ with one sheet (usually the upper one) representing the set of points with $z > 0$.
In hyperbolic geometry, one elegant way to visualize non-Euclidean space is through the Poincaré disk model. This model can be derived from a higher-dimensional perspective by considering a [two-sheeted hyperboloid](https://en.wikipedia.org/wiki/Hyperboloid#Hyperboloid_of_two_sheets). By introducing an extra dimension, we can construct the [hyperboloid](https://en.wikipedia.org/wiki/Hyperboloid) where its equation typically takes the form : %%x^2 + y^2 - z^2 = -1%% with one sheet (usually the upper one) representing the set of points with %%z > 0%%.

https://github.com/user-attachments/assets/fc13c232-8755-4ced-a09e-4cbd4d35e02d
![filename](429670801-fc13c232-8755-4ced-a09e-4cbd4d35e02d.mp4 ':include :type=iframe')

[Source](https://github.com/user-attachments/assets/fc13c232-8755-4ced-a09e-4cbd4d35e02d)

### Points

Expand All @@ -20,38 +22,44 @@ $$H = \{ (a, b, c) \in \mathbb{R}^3 \mid a^2 + b^2 - c^2 = -1, \quad c > 0 \}.$$
The Poincaré disk model is given by the unit disk in the Euclidean plane:
$$D = \{ (x, y) \in \mathbb{R}^2 \mid x^2 + y^2 < 1 \}$$

The stereographic projection from the upper sheet of the hyperboloid model $H$ onto the Poincaré disk $D$ is defined as follows. Given a point $P(a, b, c) \in H $, the corresponding point $P'$ in the disk $D$ is:
The stereographic projection from the upper sheet of the hyperboloid model %%H%% onto the Poincaré disk %%D%% is defined as follows. Given a point %%P(a, b, c) \in H %%, the corresponding point %%P'%% in the disk %%D%% is:
$$P' \left( x, y \right) = \left( \frac{a}{c+1}, \frac{b}{c+1} \right).$$

This establishes a map between the upper sheet of the hyperboloid and the unit disk.

_A simple [Desmos](https://www.desmos.com/3d/nh9airbdob) example_

https://github.com/user-attachments/assets/43b8c25a-ea0f-447e-a6e8-42bb7ddf9f10
![filename2](430654353-43b8c25a-ea0f-447e-a6e8-42bb7ddf9f10.mp4 ':include :type=iframe')

[Source](https://github.com/user-attachments/assets/43b8c25a-ea0f-447e-a6e8-42bb7ddf9f10)

### Geodesies

In general geometry, a [geodesic](https://en.wikipedia.org/wiki/Geodesic) is the shortest path between two points in a given space. In Euclidean geometry, geodesics are straight lines. However, in the hyperbolic plane, which follows the principles of hyperbolic geometry, geodesics behave quite differently due to the curvature of the space.

The hyperbolic plane, because of this curvature, the shortest paths, or geodesics, are not straight lines in the usual sense but instead take specific forms depending on the model used to represent the hyperbolic plane.

https://github.com/user-attachments/assets/9a24ac4c-7504-471e-b9ec-f49a3f9c79f5
![filename3](430622602-9a24ac4c-7504-471e-b9ec-f49a3f9c79f5.mp4 ':include :type=iframe')

[Source](https://github.com/user-attachments/assets/9a24ac4c-7504-471e-b9ec-f49a3f9c79f5)

### Circles

Circles in the hyperbolic plane are also quite different from their Euclidean counterparts. A hyperbolic circle consists of all points at a fixed hyperbolic distance from a given center. However, due to the nature of hyperbolic distance, these circles often appear distorted in Euclidean representations of the hyperbolic plane. In the Poincaré disk model, hyperbolic circles resemble Euclidean circles but have different radii when measured with hyperbolic distance. The key difference is that the hyperbolic radius grows exponentially compared to the Euclidean radius.

https://github.com/user-attachments/assets/7b52a693-1928-4205-96b5-63fa361ec08e
![filename4](430623630-7b52a693-1928-4205-96b5-63fa361ec08e.mp4 ':include :type=iframe')

[Source](https://github.com/user-attachments/assets/7b52a693-1928-4205-96b5-63fa361ec08e)

## Geometry in the Poincaré disk model

The Poincaré disk model provides a conformal map of the hyperbolic plane onto the Euclidean unit disk $D={(x,y)∈R^2∣x^2+y^2<1}$. This means that while distances and straight lines (geodesics) are represented differently, angles between intersecting curves are preserved just as they are in the hyperbolic space itself.
The Poincaré disk model provides a conformal map of the hyperbolic plane onto the Euclidean unit disk %%D={(x,y)∈R^2∣x^2+y^2<1}%%. This means that while distances and straight lines (geodesics) are represented differently, angles between intersecting curves are preserved just as they are in the hyperbolic space itself.

### Hyperbolic Distance (Intuitive Notion)

One of the most striking features of the Poincaré disk is how it represents hyperbolic distance. Unlike the Euclidean plane where distance is uniform, in the Poincaré disk, distances become increasingly large as you approach the boundary circle ($x^2+y^2=1$). Imagine the disk as a map of an infinite world; the boundary circle represents "infinity." Moving from the center towards the edge requires exponentially more effort (or covers exponentially more hyperbolic distance) for the same Euclidean distance traveled on the map.
One of the most striking features of the Poincaré disk is how it represents hyperbolic distance. Unlike the Euclidean plane where distance is uniform, in the Poincaré disk, distances become increasingly large as you approach the boundary circle (%%x^2+y^2=1%%). Imagine the disk as a map of an infinite world; the boundary circle represents "infinity." Moving from the center towards the edge requires exponentially more effort (or covers exponentially more hyperbolic distance) for the same Euclidean distance traveled on the map.

For two points P1​ and P2​ inside the disk, the hyperbolic distance d(P1​,P2​) is not simply the Euclidean distance between them. The formula involves logarithms and depends on their positions relative to the center and the boundary. Intuitively, two points close to the boundary, even if they look close in the Euclidean sense within the disk, can be very far apart in terms of hyperbolic distance.
For two points %%P_1%%​ and %%P_2%%​ inside the disk, the hyperbolic distance %%d(P_1​,P_2​)%% is not simply the Euclidean distance between them. The formula involves logarithms and depends on their positions relative to the center and the boundary. Intuitively, two points close to the boundary, even if they look close in the Euclidean sense within the disk, can be very far apart in terms of hyperbolic distance.

Understanding the reason for this formula is not necessary:

Expand All @@ -66,11 +74,13 @@ $$
In hyperbolic geometry, geodesics are the paths of shortest distance between two points. In the Poincaré disk model, these paths are not Euclidean straight lines (unless they pass through the center of the disk). Instead, geodesics take two forms:

- Diameters: Any straight line segment that passes through the center of the disk (i.e., a diameter) represents a hyperbolic geodesic.
- Circular Arcs Orthogonal to the Boundary: Any arc of a Euclidean circle that intersects the boundary circle ($x^2+y^2=1$) at a right angle (90 degrees) represents a hyperbolic geodesic.
- Circular Arcs Orthogonal to the Boundary: Any arc of a Euclidean circle that intersects the boundary circle (%%x^2+y^2=1%%) at a right angle (90 degrees) represents a hyperbolic geodesic.

The circular arcs orthogonal to the boundary can be described by two reals a and b such that the circle is equal to %%x^2+y^2+a.x+b.y=0%%

The circular arcs orthogonal to the boundary can be described by two reals a and b such that the circle is equal to $x^2+y^2+a.x+b.y=0$
![filename5](431992681-f39a0f90-59ad-4b11-a409-f35d7ea86962.mp4 ':include :type=iframe')

https://github.com/user-attachments/assets/f39a0f90-59ad-4b11-a409-f35d7ea86962
[Source](https://github.com/user-attachments/assets/f39a0f90-59ad-4b11-a409-f35d7ea86962)

### Circles (Brief Mention)

Expand Down
File renamed without changes
6 changes: 4 additions & 2 deletions docs/I/introduction.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# introduction
# Introduction

## Introduction to Euclidean Geometry & Beyond

Expand Down Expand Up @@ -28,7 +28,9 @@ tool: [the Poincaré disk model](https://en.wikipedia.org/wiki/Poincar%C3%A9_dis

## The Poincaré disk model

![poincaré disk model](/docs/disk.svg)
<div align=center style="text-align: center;">
<img width="550" src="I/disk.svg"/>
</div>

In the [Poincaré disk](https://en.wikipedia.org/wiki/Poincar%C3%A9_disk_model), the entire infinite hyperbolic plane is
compressed into the interior of a circle. But there’s a catch—the edge of the circle represents points at infinity. Just
Expand Down
26 changes: 17 additions & 9 deletions docs/I/isometries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Euclidean Isometry

A **Euclidean [isometry](https://en.wikipedia.org/wiki/Isometry)** is a transformation of the Euclidean space that preserves distances between all points. In other words, if you have a map $f: \mathbb{R}^n \to \mathbb{R}^n$, it is an isometry if, for every pair of points $x$ and $y$ in the space, the distance between $x$ and $y$ is exactly the same as the distance between $f(x)$ and $f(y)$; mathematically,
A **Euclidean [isometry](https://en.wikipedia.org/wiki/Isometry)** is a transformation of the Euclidean space that preserves distances between all points. In other words, if you have a map %%f: \mathbb{R}^n \to \mathbb{R}^n%%, it is an isometry if, for every pair of points %%x%% and %%y%% in the space, the distance between %%x%% and %%y%% is exactly the same as the distance between %%f(x)%% and %%f(y)%%; mathematically,

$$d(f(x), f(y)) = d(x, y).$$

Expand All @@ -12,31 +12,39 @@ The consequence of this property is that the overall shape, size, and angles of
- **[Rotations](<https://en.wikipedia.org/wiki/Rotation_(mathematics)>):** Turning the figure around a fixed center while keeping the distances from the center the same.
- **[Reflections](<https://en.wikipedia.org/wiki/Reflection_(mathematics)>):** Flipping the figure over a line (in the plane) or a plane (in space) such that the mirror image is congruent to the original.

https://github.com/user-attachments/assets/f230a181-cefe-4da6-aec3-966e8b1aa580
![filename](433268541-f230a181-cefe-4da6-aec3-966e8b1aa580.mp4 ':include :type=iframe')

[Source](https://github.com/user-attachments/assets/f230a181-cefe-4da6-aec3-966e8b1aa580)

Together, these transformations form the Euclidean group, which encompasses all the symmetries of Euclidean space.

## Non-Euclidean Isometries – An Intuitive Overview

> [!IMPORTANT]
> It is useful to understand the key concepts of complex numbers and their geometric interpretation. For more information, see the [Complex Numbers](/docs/complex_numbers.md) page.
> It is useful to understand the key concepts of complex numbers and their geometric interpretation. For more information, see the [Complex Numbers](complex_numbers.md) page.

In non-Euclidean geometries, the notion of an isometry retains the essential idea of distance preservation, but it adapts to the underlying curved space. In particular, the isometries of hyperbolic space differ from those of Euclidean and spherical space in the following ways:

- **Hyperbolic Translations:** In hyperbolic space, the concept of a translation differs from the Euclidean case. Instead of sliding along a straight line in flat space, hyperbolic translations move points along geodesics in a manner that preserves the hyperbolic distance. Mathematically, a hyperbolic translation function can be written as a [Mobius transformation](https://en.wikipedia.org/wiki/M%C3%B6bius_transformation) of the form $f(z) = \frac{z - a}{1 - \overline{a} z}$, where $a$ is a [complex number](https://en.wikipedia.org/wiki/Complex_number).
- **Hyperbolic Translations:** In hyperbolic space, the concept of a translation differs from the Euclidean case. Instead of sliding along a straight line in flat space, hyperbolic translations move points along geodesics in a manner that preserves the hyperbolic distance. Mathematically, a hyperbolic translation function can be written as a [Mobius transformation](https://en.wikipedia.org/wiki/M%C3%B6bius_transformation) of the form %%f(z) = \frac{z - a}{1 - \overline{a} z}%%, where %%a%% is a [complex number](https://en.wikipedia.org/wiki/Complex_number).

![filename2](433169788-c9113e5d-2f8a-4996-af72-3f9cad6f2782.mp4 ':include :type=iframe')

https://github.com/user-attachments/assets/c9113e5d-2f8a-4996-af72-3f9cad6f2782
[Source](https://github.com/user-attachments/assets/c9113e5d-2f8a-4996-af72-3f9cad6f2782)

- **Rotations:** Around a fixed point, you can rotate figures similarly to Euclidean rotations, but the way distances and angles behave is governed by the hyperbolic metric. These rotations preserve the structure and distance relationships as defined in the hyperbolic model. Mathematically, a hyperbolic rotation function can be written as a [Mobius transformation](https://en.wikipedia.org/wiki/M%C3%B6bius_transformation) of the form $f(z) = e^{i \theta} z$, where $\theta$ is the angle of rotation.
- **Rotations:** Around a fixed point, you can rotate figures similarly to Euclidean rotations, but the way distances and angles behave is governed by the hyperbolic metric. These rotations preserve the structure and distance relationships as defined in the hyperbolic model. Mathematically, a hyperbolic rotation function can be written as a [Mobius transformation](https://en.wikipedia.org/wiki/M%C3%B6bius_transformation) of the form %%f(z) = e^{i \theta} z%%, where %%\theta%% is the angle of rotation.

https://github.com/user-attachments/assets/b7bea3fe-10f0-4d41-838d-b4e75249307a
![filename3](433169799-b7bea3fe-10f0-4d41-838d-b4e75249307a.mp4 ':include :type=iframe')

- **Reflections and Glide Reflections:** Just like in Euclidean geometry, hyperbolic geometry allows for reflections across geodesic lines and combinations of reflections and translations (glide reflections), all while preserving the hyperbolic distances. Mathematically, a reflection function can be written as a [inverse function](https://en.wikipedia.org/wiki/Inversive_geometry) with respect to the euclidean circle that represents the geodesic line. We have, where $R$ is the radius of the circle and $(x_0, y_0)$ is the center of the circle, $(x, y)$ is the point of reflection and $(f(x), g(y))$ is the reflected point.
[Source](https://github.com/user-attachments/assets/b7bea3fe-10f0-4d41-838d-b4e75249307a)

- **Reflections and Glide Reflections:** Just like in Euclidean geometry, hyperbolic geometry allows for reflections across geodesic lines and combinations of reflections and translations (glide reflections), all while preserving the hyperbolic distances. Mathematically, a reflection function can be written as a [inverse function](https://en.wikipedia.org/wiki/Inversive_geometry) with respect to the euclidean circle that represents the geodesic line. We have, where %%R%% is the radius of the circle and %%(x_0, y_0)%% is the center of the circle, %%(x, y)%% is the point of reflection and %%(f(x), g(y))%% is the reflected point.

$$f(x) = x_0 + \frac{R^2 (x - x_0)}{(x - x_0)^2 + (y - y_0)^2}$$

$$g(y) = y_0 + \frac{R^2 (y - y_0)}{(x - x_0)^2 + (y - y_0)^2}$$

https://github.com/user-attachments/assets/e2048917-90da-4aa3-92c3-97be560b9f47
![filename4](433169809-e2048917-90da-4aa3-92c3-97be560b9f47.mp4 ':include :type=iframe')

[Source](https://github.com/user-attachments/assets/e2048917-90da-4aa3-92c3-97be560b9f47)

Intuitively, hyperbolic isometries are all the “symmetry moves” that you can apply without altering the intrinsic geometry of a hyperbolic plane—no stretching or shrinking occurs, only repositioning within the framework of hyperbolic distance. They form a rich group of transformations that often exhibit properties markedly different from our everyday experience of Euclidean space.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading