Sphere

Provide functions for the creation and manipulation of 3D Spheres.

Sphere are represented using a numpy.array of shape (4,).

The first three values are the sphere’s position. The fourth value is the sphere’s radius.

pyrr.sphere.create(*args, **kwargs)
pyrr.sphere.create_from_points(*args, **kwargs)

Creates a sphere centred around 0,0,0 that encompasses the furthest point in the provided list.

Parameters:points (numpy.array) – An Nd array of vectors.
Return type:A sphere as a two value tuple.
pyrr.sphere.position(*args, **kwargs)

Returns the position of the sphere.

Parameters:sphere (numpy.array) – The sphere to extract the position from.
Return type:numpy.array
Returns:The centre of the sphere.
pyrr.sphere.radius(*args, **kwargs)

Returns the radius of the sphere.

Parameters:sphere (numpy.array) – The sphere to extract the radius from.
Return type:float
Returns:The radius of the sphere.