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
cbe09cbd
Commit
cbe09cbd
authored
May 20, 2022
by
Manuel Schrauth
Browse files
add docstring
parent
7284d59b
Pipeline
#15300
passed with stages
in 15 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
hypertiling/hyperpolygon.py
View file @
cbe09cbd
...
...
@@ -184,8 +184,19 @@ class HyperPolygon:
self
.
angle
=
math
.
degrees
(
math
.
atan2
(
self
.
centerP
().
imag
,
self
.
centerP
().
real
))
self
.
angle
+=
360
if
self
.
angle
<
0
else
0
# compute in which sector out of k sectors the polygon resides
def
find_sector
(
self
,
k
,
offset
=
0
):
"""
compute in which sector out of k sectors the polygon resides
Arguments
---------
k : int
number of equal-sized sectors
offset : float, optional
rotate sectors by an angle
"""
self
.
sector
=
floor
((
self
.
angle
-
offset
)
/
(
360
/
k
))
# mirror on the x-axis
...
...
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