Source code for picogl.core.vec4

"""Four-component vector value object."""

from dataclasses import dataclass

from picogl.core.mixin.vec4 import Vec4Mixin


@dataclass(frozen=True)
[docs] class Vec4(Vec4Mixin): """A four-component vector, including homogeneous coordinates."""
[docs] x: float
[docs] y: float
[docs] z: float
[docs] w: float = 1.0
[docs] def to_tuple(self) -> tuple[float, float, float, float]: """Return the vector components as a tuple.""" return self.x, self.y, self.z, self.w