-
-
Notifications
You must be signed in to change notification settings - Fork 73
Geometries
HyperRogue currently supports four primary geometries, with many tilings and several quotient spaces, in two or three dimensions.
Euclidean geometry is the geometry that we are used to. In Euclidean geometry, given a line and a point, there is one parallel line that crosses the point.
Some interesting aspects of Euclidean geometry are:
- The angles on the inside of any polygon add up to (n - 2) ⋅ 180°, where n is the number of sides. For triangles, this number is 180°.
- As a circle grows, its circumference grows linearly, while its area grows quadratically.
- The limit as a circle grows to infinity is a line.
Hyperbolic geometry is the default geometry that HyperRogue starts with, its namesake, and the geometry that inspired the game. In hyperbolic geometry, given a line and a point, there are infinitely many lines that cross the point while not touching the line.
Hyperbolic geometry differs from regular Euclidean geometry in many ways, including:
- The angles on the inside of any polygon add up to (n - 2) ⋅ 180° minus a value proportional to the area of the polygon.
- As a circle grows, its circumference and area both grow exponentially.
- The limit as a circle grows to infinity is a horocycle.
The exponential growth in the circumference of a circle, and in the surface area of a sphere means that as things move away from you, the speed at which they appear to shrink doesn't slow down like it does in Euclidean or spherical geometry. It also means that it's very easy to get lost if you walk too far from a given point, and you can't see it anymore.
In addition, because parallel lines diverge, your eyes won't be able to see anything if they try to look in parallel, and they have to converge in order to focus on anything. It will look like you're inside a sphere a few meters wide, with far away things appearing small, but not that far away.
Spherical geometry is the geometry found on the surface of a sphere. However, being in spherical geometry is not the same as being on the surface of a sphere. Only 2D beings that are embedded within the surface of the sphere, and know nothing about the space outside the sphere, are living in spherical geometry.
In spherical geometry, given a line and a point, there are no lines that cross the point while not touching the line. You can think of this on the surface of an actual sphere, where two great circles will always intersect at one or more points.
Spherical geometry differs from the previously mentioned geometries in the following ways:
- The angles on the inside of any polygon add up to (n - 2) ⋅ 180° plus a value proportional to the area of the polygon.
- As a circle grows, its circumference and area grows, and then slows down before the circle becomes a great circle, or line.
- The limit as a circle grows to infinity is a great circle, or line.
Solv geometry, also known as Sol geometry, is an unusual type of geometry. Unlike the previous three, it is not described by the modification of the rule applying to parallel lines (Euclid's parallel postulate in Euclidean geometry), but by a rule that applies to lines parallel to the Z axis.
If you are traveling along a line parallel to the Z axis in Solv geometry, as your Z increases, X positions double while Y positions halve. That is, (x, y, z) -> (x * 2, y / 2, z + 1).
This has a number of implications, some of which are non-obvious given the explanation here. For example, a straight line between two points may head in the +Z direction, so that it can multiply its movements in the Y direction when it returns, and then in the -Z direction, so that it can multiply its movements in the X direction when it returns. This can be done in either order, which means that there may be more than one straight line between two points.
As a result, if you enable the native perspective projection in Solv geometry, the world that you see will look very strange. Surfaces orthogonal to the Z axis, such as Great Walls, will look like giant saddles or donuts that cover more than half of your view.
Looking towards the X direction of such a surface that is at a lower Z position than you, light rays from that part of the surface avoid moving in the +Z direction until they have moved much of the way in the X direction. This is because when they do move in the Z direction, they will have to move several times as much in the scaled up X direction to reach you, which means that they hit you from a different angle, and you see the surface curve away from you in that direction.
Similarly, looking towards the Y direction of such a surface, light rays will move in the +Z direction earlier, which means that they don't have to move as much in the Y direction, as the Y values are scaled down. They hit you from an angle that makes the surface appear to curve towards you in that direction. The inverse is true for surfaces that are at a higher Z position than you, as light rays from both directions will have to move in the -Z direction instead.
If you are sandwiched between two such surfaces, they will look like the parts of two interlocking donuts. However, you cannot escape the donuts. If you enable the simple perspective projection, you can see that this is similar to Euclidean geometry when you are sandwiched between two XY planes.