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

Fix genus 4 prym eigenform printing #233

Open sfreedman67 opened 1 year ago

sfreedman67 commented 1 year ago

I found some code that improves how the Prym eigenform in genus 4 prints:

def g4_graphical_surface(w, h, t, e):
    s = prym4(w, h, t, e)
    D = e^2 + 4 * w * h
    lmbd = (e + sqrt(D))/2
    from flatsurf.geometry.similarity import SimilarityGroup
    SG = SimilarityGroup(QQbar)
    def pos(n):
        if n == 0:
            return SG((0, 0))
        elif n == 1:
            return SG((-(w/2 - lmbd/2), lmbd/2))
        elif n == 2:
            return SG((-lmbd/2, lmbd/2 + h/2))
        elif n == 3:
            return SG((-lmbd/2, lmbd/2 + h))
        else:
            assert False
    return s.graphical_surface(cached=False, polygon_labels=False, edge_labels=False, default_position_function=pos)

(It wouldn't be hard to improve the printing of the genus 3 eigenform either.)

saraedum commented 11 months ago

I am changing quite a bit how plotting works in #243. I am wondering about adding a better layouting algorithm to sage-flatsurf. Maybe it's a good idea to discuss how this generalizes to more general surfaces in our weekly call.