4-D vector operations.
Used for RGBA colors, homogeneous coordinates and quaternions (when the
fourth component is treated as w/real).
pub type Vec4 {
Vec4(x: Float, y: Float, z: Float, w: Float)
}
Constructors
-
Vec4(x: Float, y: Float, z: Float, w: Float)
pub fn clamp(v: Vec4, lo: Float, hi: Float) -> Vec4
pub fn distance(a: Vec4, b: Vec4) -> Float
pub fn is_close(a: Vec4, b: Vec4, tol: Float) -> Bool
pub fn length(v: Vec4) -> Float
Length using two-level hypot to avoid overflow at extreme scales.
pub fn length_squared(v: Vec4) -> Float
pub fn multiply(a: Vec4, b: Vec4) -> Vec4
Hadamard (component-wise) product.
pub fn splat(value: Float) -> Vec4