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
30db489d
Commit
30db489d
authored
Dec 10, 2021
by
Manuel Schrauth
Browse files
adjust notebooks
parent
85b86754
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
examples/geodesics.ipynb
View file @
30db489d
This diff is collapsed.
Click to expand it.
examples/refinements.ipynb
View file @
30db489d
This diff is collapsed.
Click to expand it.
hypertiling/geodesics.py
View file @
30db489d
...
...
@@ -60,30 +60,13 @@ def circle_through_three_points(z1, z2, z3, verbose=False):
from
.transformation
import
moeb_origin_trafo
,
moeb_origin_trafo_inverse
from
.distance
import
disk_distance
# return the midpoint betwen z1 and z2 along the geodesic arc
# which connects the two points
# return the geodesic midpoint betwen z1 and z2
def
geodesic_midpoint
(
z1
,
z2
):
<<<<<<<
HEAD
z2n
=
moeb_origin_trafo
(
z1
,
z2
)
d
=
disk_distance
(
0
,
z2n
)
r
=
np
.
tanh
(
d
/
4
)
zm
=
r
*
np
.
exp
(
1j
*
np
.
angle
(
z2n
))
zm
=
moeb_origin_trafo_inverse
(
z1
,
zm
)
=======
z3
=
unit_circle_inversion
(
z1
)
zc
,
radius
=
circle_through_three_points
(
z1
,
z2
,
z3
)
if
radius
==
-
1
:
return
(
z1
+
z2
)
/
2
# there are always two solutions
# we are only interested in the midpoint which
# lies inside the unit circle
zm
=
compute_midpoint
(
z1
,
z2
,
zc
)
if
np
.
abs
(
zm
)
>
1
:
zm
=
compute_midpoint
(
z2
,
z1
,
zc
)
>>>>>>>
6
-
improve
-
lattice
-
refinements
z2n
=
moeb_origin_trafo
(
z1
,
z2
)
# move z1, z2 such that z0=0
d
=
disk_distance
(
0
,
z2n
)
# distance betwen 0 and z2new
r
=
np
.
tanh
(
d
/
4
)
# compute corresponding Cartesian radius
zm
=
r
*
np
.
exp
(
1j
*
np
.
angle
(
z2n
))
# add angle
zm
=
moeb_origin_trafo_inverse
(
z1
,
zm
)
# and transform back
return
zm
...
...
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