Skip to content

Commit

Permalink
Update generation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hanruihua committed Dec 31, 2024
1 parent c728170 commit 61d2433
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions irsim/lib/algorithm/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def generate_polygon(center, avg_radius, irregularity, spikeyness, num_vertices)
angle_steps = random_angle_steps(num_vertices, irregularity)

points = []
angle = random.uniform(0, 2 * math.pi)
angle = np.random.uniform(0, 2 * math.pi)
for i in range(num_vertices):
radius = clip(random.gauss(avg_radius, spikeyness), 0, 2 * avg_radius)
point = (
Expand Down Expand Up @@ -113,7 +113,7 @@ def random_angle_steps(steps: int, irregularity: float) -> List[float]:
upper = (2 * math.pi / steps) + irregularity
cumsum = 0
for i in range(steps):
angle = random.uniform(lower, upper)
angle = np.random.uniform(lower, upper)
angles.append(angle)
cumsum += angle

Expand Down

0 comments on commit 61d2433

Please sign in to comment.