Regular polygons in the upper half model for hyperbolic plane

AUTHORS:

  • Javier Honrubia (2016-01)

class sage.plot.hyperbolic_regular_polygon.HyperbolicRegularPolygon(sides, i_angle, center, options)[source]

Bases: HyperbolicPolygon

Primitive class for regular hyperbolic polygon type.

See hyperbolic_regular_polygon? for information about plotting a hyperbolic regular polygon in the upper complex halfplane.

INPUT:

  • sides – number of sides of the polygon

  • i_angle – interior angle of the polygon

  • center – center point as a complex number of the polygon

EXAMPLES:

Note that constructions should use hyperbolic_regular_polygon():

sage: from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
sage: print(HyperbolicRegularPolygon(5,pi/2,I, {}))
Hyperbolic regular polygon (sides=5, i_angle=1/2*pi, center=1.00000000000000*I)
>>> from sage.all import *
>>> from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
>>> print(HyperbolicRegularPolygon(Integer(5),pi/Integer(2),I, {}))
Hyperbolic regular polygon (sides=5, i_angle=1/2*pi, center=1.00000000000000*I)
from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
print(HyperbolicRegularPolygon(5,pi/2,I, {}))

The code verifies is there exists a compact hyperbolic regular polygon with the given data, checking

\[A(\mathcal{P}) = \pi(s-2) - s \cdot \alpha > 0,\]

where \(s\) is sides and \(\alpha\) is i_angle. This raises an error if the i_angle is less than the minimum to generate a compact polygon:

sage: from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
sage: P = HyperbolicRegularPolygon(4, pi/2, I, {})
Traceback (most recent call last):
...
ValueError: there exists no hyperbolic regular compact polygon,
 for sides=4 the interior angle must be less than 1/2*pi
>>> from sage.all import *
>>> from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
>>> P = HyperbolicRegularPolygon(Integer(4), pi/Integer(2), I, {})
Traceback (most recent call last):
...
ValueError: there exists no hyperbolic regular compact polygon,
 for sides=4 the interior angle must be less than 1/2*pi
from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
P = HyperbolicRegularPolygon(4, pi/2, I, {})

It is an error to give a center outside the upper half plane in this model

sage: from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
sage: P = HyperbolicRegularPolygon(4, pi/4, 1-I, {})
Traceback (most recent call last):
...
ValueError: center: 1.00000000000000 - 1.00000000000000*I is not
 a valid point in the upper half plane model of the hyperbolic plane
>>> from sage.all import *
>>> from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
>>> P = HyperbolicRegularPolygon(Integer(4), pi/Integer(4), Integer(1)-I, {})
Traceback (most recent call last):
...
ValueError: center: 1.00000000000000 - 1.00000000000000*I is not
 a valid point in the upper half plane model of the hyperbolic plane
from sage.plot.hyperbolic_regular_polygon import HyperbolicRegularPolygon
P = HyperbolicRegularPolygon(4, pi/4, 1-I, {})
sage.plot.hyperbolic_regular_polygon.hyperbolic_regular_polygon(sides, i_angle, center=1.00000000000000 * I, alpha=1, fill=False, thickness=1, rgbcolor='blue', zorder=2, linestyle='solid', **options)[source]

Return a hyperbolic regular polygon in the upper half model of Hyperbolic plane given the number of sides, interior angle and possibly a center.

Type ?hyperbolic_regular_polygon to see all options.

INPUT:

  • sides – number of sides of the polygon

  • i_angle – interior angle of the polygon

  • center – (default: \(i\)) hyperbolic center point (complex number) of the polygon

OPTIONS:

  • alpha – (default: 1)

  • fill – (default: False)

  • thickness – (default: 1)

  • rgbcolor – (default: 'blue')

  • linestyle – (default: 'solid') the style of the line, which can be one of the following:

    • 'dashed' or '--'

    • 'dotted' or ':'

    • 'solid' or '-'

    • 'dashdot' or '-.'

EXAMPLES:

Show a hyperbolic regular polygon with 6 sides and square angles:

sage: g = hyperbolic_regular_polygon(6, pi/2)
sage: g.plot()
Graphics object consisting of 1 graphics primitive
>>> from sage.all import *
>>> g = hyperbolic_regular_polygon(Integer(6), pi/Integer(2))
>>> g.plot()
Graphics object consisting of 1 graphics primitive
g = hyperbolic_regular_polygon(6, pi/2)
g.plot()
../../_images/hyperbolic_regular_polygon-1.svg

With more options:

sage: g = hyperbolic_regular_polygon(6, pi/2, center=3+2*I, fill=True, color='red')
sage: g.plot()
Graphics object consisting of 1 graphics primitive
>>> from sage.all import *
>>> g = hyperbolic_regular_polygon(Integer(6), pi/Integer(2), center=Integer(3)+Integer(2)*I, fill=True, color='red')
>>> g.plot()
Graphics object consisting of 1 graphics primitive
g = hyperbolic_regular_polygon(6, pi/2, center=3+2*I, fill=True, color='red')
g.plot()
../../_images/hyperbolic_regular_polygon-2.svg

The code verifies is there exists a hyperbolic regular polygon with the given data, checking

\[A(\mathcal{P}) = \pi(s-2) - s \cdot \alpha > 0,\]

where \(s\) is sides and \(\alpha\) is i_angle. This raises an error if the i_angle is less than the minimum to generate a compact polygon:

sage: hyperbolic_regular_polygon(4, pi/2)
Traceback (most recent call last):
...
ValueError: there exists no hyperbolic regular compact polygon,
 for sides=4 the interior angle must be less than 1/2*pi
>>> from sage.all import *
>>> hyperbolic_regular_polygon(Integer(4), pi/Integer(2))
Traceback (most recent call last):
...
ValueError: there exists no hyperbolic regular compact polygon,
 for sides=4 the interior angle must be less than 1/2*pi
hyperbolic_regular_polygon(4, pi/2)

It is an error to give a center outside the upper half plane in this model:

sage: from sage.plot.hyperbolic_regular_polygon import hyperbolic_regular_polygon
sage: hyperbolic_regular_polygon(4, pi/4, 1-I)
Traceback (most recent call last):
...
ValueError: center: 1.00000000000000 - 1.00000000000000*I is not
 a valid point in the upper half plane model of the hyperbolic plane
>>> from sage.all import *
>>> from sage.plot.hyperbolic_regular_polygon import hyperbolic_regular_polygon
>>> hyperbolic_regular_polygon(Integer(4), pi/Integer(4), Integer(1)-I)
Traceback (most recent call last):
...
ValueError: center: 1.00000000000000 - 1.00000000000000*I is not
 a valid point in the upper half plane model of the hyperbolic plane
from sage.plot.hyperbolic_regular_polygon import hyperbolic_regular_polygon
hyperbolic_regular_polygon(4, pi/4, 1-I)