distrib_uni_sphere

erwans3.utils.distrib_uni_sphere(npoint: int, r: Union[int, float, Quantity] = 1, representation: Optional[Any] = None) Any

Generate random points uniformly distributed on the surface of a sphere.

Note: - The points are generated using spherical coordinates and then converted to Cartesian coordinates. - The radius should be a positive value.

Parameters:
  • npoint (int) – Number of points to generate.

  • r (int or float or Quantity, optional) – Radius of the sphere. Default is 1.

  • representation (Any, optional) – Representation type for the generated points (CartesianRepresentation, SkyCoord, np.ndarray). If None, returns the points as a numpy array. Default is None.

Returns:

Random points in the specified representation type. as an array, the shape is (npoint, 3)

Return type:

Any