Skip to content

Commit

Permalink
Skip more unnecessary calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Gouvernathor committed Aug 15, 2024
1 parent 9c50b62 commit 8324064
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/parliamentarch/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ def get_seats_centers(nseats: int, *,
# row radius : the radius of the circle crossing the center of each seat in the row
row_arc_radius = .5 + 2*r*row_thicc

# the angle necessary in this row to put the first (and last) seats fully in the canvas
angle_margin = math.asin(row_thicc/row_arc_radius)
# add the margin to make up the side angle
angle_margin += span_angle_margin
# alternatively, allow the centers of the seats by the side to reach the angle's boundary
# angle_margin = max(angle_margin, span_angle_margin)

if nseats_this_row == 1:
positions[1., row_arc_radius] = math.pi/2
else:
# the angle necessary in this row to put the first (and last) seats fully in the canvas
angle_margin = math.asin(row_thicc/row_arc_radius)
# add the margin to make up the side angle
angle_margin += span_angle_margin
# alternatively, allow the centers of the seats by the side to reach the angle's boundary
# angle_margin = max(angle_margin, span_angle_margin)

# the angle separating two seats of that row
angle_increment = (math.pi-2*angle_margin) / (nseats_this_row-1)
# a fraction of the remaining space,
Expand Down

0 comments on commit 8324064

Please sign in to comment.