Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hypertiling
hypertiling
Commits
f66405ae
Commit
f66405ae
authored
Jul 01, 2022
by
Florian Goth
Browse files
add more docs
parent
2b607112
Pipeline
#15756
passed with stages
in 15 minutes and 23 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
hypertiling/hyperpolygon.py
View file @
f66405ae
...
...
@@ -3,35 +3,53 @@ import numpy as np
from
.transformation
import
*
def
morigin_py
(
p
,
z0
,
verticesP
):
''' Apply Moebius transform to all vertices.'''
for
i
in
range
(
p
+
1
):
z
=
moeb_origin_trafo
(
z0
,
verticesP
[
i
])
verticesP
[
i
]
=
z
def
morigin_inv_py
(
p
,
z0
,
verticesP
):
''' Apply inverse Moebius trafo to all vertices.'''
for
i
in
range
(
p
+
1
):
z
=
moeb_origin_trafo_inverse
(
z0
,
verticesP
[
i
])
verticesP
[
i
]
=
z
def
mrotate_py
(
p
,
phi
,
verticesP
):
''' Rotate all vertices.'''
for
i
in
range
(
p
+
1
):
z
=
moeb_rotate_trafo
(
verticesP
[
i
],
-
phi
)
verticesP
[
i
]
=
z
def
mfull_point_py
(
z0
,
phi
,
p
):
''' Apply all transformations(origin, rotate, inv_origin) to a single vertex.'''
z
=
moeb_origin_trafo
(
z0
,
p
)
z
=
moeb_rotate_trafo
(
z
,
-
phi
)
return
moeb_origin_trafo_inverse
(
z0
,
z
)
def
mfull_py
(
p
,
phi
,
ind
,
verticesP
):
z0
=
verticesP
[
ind
]
dz0
=
complex
(
0
,
0
)
for
i
in
range
(
p
+
1
):
z
,
dz
=
moeb_origin_trafodd
(
z0
,
dz0
,
verticesP
[
i
],
dz0
)
z
,
dz
=
moeb_rotate_trafodd
(
z
,
dz
,
-
phi
)
z
,
dz
=
moeb_origin_trafo_inversedd
(
z0
,
dz0
,
z
,
dz
)
verticesP
[
i
]
=
z
#verticesdP[i] = dz
"""
Apply all transformations(origin, rotate, inv_origin) in dd precision to the vertices of an entire polygon.
Arguements:
-----------
p : int
Number of outer vertices.
phi : float
Angle of roatation
ind : int
Index of vertex that defines the Moebius Transform
verticesP : Hyperpolygon
Array of vertices that make up the polygon.
"""
z0
=
verticesP
[
ind
]
dz0
=
complex
(
0
,
0
)
for
i
in
range
(
p
+
1
):
z
,
dz
=
moeb_origin_trafodd
(
z0
,
dz0
,
verticesP
[
i
],
dz0
)
z
,
dz
=
moeb_rotate_trafodd
(
z
,
dz
,
-
phi
)
z
,
dz
=
moeb_origin_trafo_inversedd
(
z0
,
dz0
,
z
,
dz
)
verticesP
[
i
]
=
z
#verticesdP[i] = dz
# try to use numba
try
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment