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(center=None, radius=1.0, dtype=None)[source]
pyrr.sphere.create_from_points(points, dtype=None)[source]

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(sphere)[source]

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(sphere)[source]

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.