Skip to content

Commit

Permalink
fix num_radial
Browse files Browse the repository at this point in the history
  • Loading branch information
waltsims committed Dec 19, 2023
1 parent 62ac65e commit 15b2423
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kwave/utils/mapgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ def make_spiral_circle_points(num_points: int, radius: float) -> np.ndarray:

def make_concentric_circle_points(num_points: int, radius: float) -> Tuple[np.ndarray, int]:
num_radial = int(np.ceil(np.sqrt(num_points / np.pi)))
try:
d_radial = radius / (num_radial - 1)
except ZeroDivisionError:
d_radial = float('inf')

assert num_radial > 1, "The number of radial points must be greater than 1."

r = np.arange(num_radial) * (radius - d_radial / 2) / (num_radial - 1)

Expand Down

0 comments on commit 15b2423

Please sign in to comment.