flatsurf / sage-flatsurf

Flat surfaces in Sage
https://flatsurf.github.io/sage-flatsurf/
GNU General Public License v2.0
10 stars 10 forks source link

Add MutableOrientedHyperbolicSurface #243

Open saraedum opened 1 year ago

saraedum commented 1 year ago

Checklist

TODO
Demo
sage: from flatsurf import HyperbolicPlane
sage: H = HyperbolicPlane(QQ)
sage: from flatsurf import MutableOrientedHyperbolicSurface
sage: S = MutableOrientedHyperbolicSurface(H)
sage: S.add_polygon(H.polygon([
....:     H.vertical(3).left_half_space(),
....:     H.vertical(1).right_half_space(),
....:     H.half_circle(2, 4).left_half_space(),
....:     H.half_circle(2, 16).right_half_space(),
....: ]))
0
sage: S.add_polygon(H.polygon([
....:     H.vertical(3).left_half_space(),
....:     H.vertical(1).right_half_space(),
....:     H.half_circle(2, 4).left_half_space(),
....:     H.half_circle(2, 16).right_half_space(),
....: ]))
1
sage: S.polygon(0).edges()
{(2/5, 3/5) → (6/13, 11/13), (6/13, 11/13) → (6/25, 23/25), (6/25, 23/25) → (2/17, 15/17), (2/17, 15/17) → (2/5, 3/5)}
sage: S.glue((0, 0), (1, 0))
sage: S.glue((0, 1), (1, 3))
sage: S.glue((0, 2), (1, 2))
sage: S.glue((0, 3), (1, 1))
sage: S.set_immutable()
sage: S
Hyperbolic Surface with 2 orbifold points built from 2 quadrilaterals
sage: S.vertices()
{Vertex 0 of polygon 0,
 Vertex 0 of polygon 1,
 Vertex 2 of polygon 0,
 Vertex 2 of polygon 1}
sage: S.orbifold_points()
{Vertex 0 of polygon 0, Vertex 0 of polygon 1}
sage: [v.angle(numerical=True) for v in S.vertices()]
[0.419569376744834, 0.333333333333334, 0.333333333333334, 0.419569376744834]
sage: S.plot()

image

github-actions[bot] commented 1 year ago

Documentation preview for this PR is ready! :tada: Built with commit: a90724316b57b4c5013a62347020c4513cf7b0c2

videlec commented 10 months ago

Can we call _layout_one_trajectory several times (ie layout several trajectories)?

saraedum commented 10 months ago

Can we call _layout_one_trajectory several times (ie layout several trajectories)?

You can actually call gs.layout(algorithm="trajectory", trajectory=L) several times with different trajectories I think.

videlec commented 2 months ago

A useful method at the level of surfaces glued from polygon is is_orbifold() (ie whether all angles are of the form $2\pi/n$ with $n \in {1,2,\ldots}$ (one can allow $+\infty$ as well in the hyperbolic settings to mean cusp). If the surface is an orbifold, then it is a global quotient $\Gamma \backslash \mathbb{H}^2$ (hyperbolic setting) or $\Gamma \backslash \mathbb{R}^2$ (flat setting).