aspsim.room.generatepoints.equidistant_rectangle

aspsim.room.generatepoints.equidistant_rectangle(num_points, side_lengths, extra_side_lengths=0, offset=0.5, z=None)

Points are spaced evenly along the edge of a rectangle

Parameters:
  • num_points (int) – the number of total points to be returned. These will be distributed as evenly as possible

  • side_lengths (array_like of shape (2,)) – the side lengths in x and y coordinates. The corners of the rectangle will be at (-sl[0]/2, -sl[1]/2), (-sl[0]/2, sl[1]/2), (sl[0]/2, -sl[1]/2), (sl[0]/2, sl[1]/2) where sl is shorthand for side_lengths

  • extra_side_lengths (float larger or equal to 0, or a 2-tuple of such values) – if set to a non-zero value, every other point will be placed further away from the center as if the points are placed on two rectangles, the larger with side lengths of (side_lengths[0] + extra_side_lengths[0], side_lengths[1] + extra_side_lengths[1])

  • offset (float within [0,1]) – The offset from the first corner to the first microphones. If offset is 0, the first microphone is placed in the corner. If offset is 0.5, the first microphone is placed as close to the middle of its ‘segment’ as possible

  • z (float) – The z coordinate, which will be the same for all points in the rectangle. If not provided, a 2D shape will be returned

Returns:

rectangle_points – The coordinates of the points in the rectangle the shape is (num_points, 3) if z is provided, and (num_points, 2) otherwise.

Return type:

ndarray of shape (num_points, 3) or (num_points, 2)