picogl.core.vec3

Three-component vector value object.

Attributes

EPSILON

Classes

Vec3

A three-component vector.

Module Contents

picogl.core.vec3.EPSILON = 1e-12[source]
class picogl.core.vec3.Vec3[source]

Bases: picogl.core.mixin.vec3.Vec3Mixin

A three-component vector.

x: float[source]
y: float[source]
z: float[source]
__str__()[source]
to_tuple() → tuple[float, float, float][source]

Return the vector components as a tuple.

normalized() → Vec3[source]

Return a unit-length copy of this vector.

Near-zero length returns Vec3(0, 0, 0).

classmethod sphere(radius: float, lat: float, lng: float) → Vec3[source]

Point on a sphere centered at the origin.

lat is latitude in radians (-pi/2 at the south pole, +pi/2 at the north pole). lng is longitude in radians.