Creates a new mutable scalar with 64-bit float precision.
The typed array containing the scalar value
Gets the number of bytes per component in the underlying typed array.
The number of bytes per element
Gets the class name of this vector instance.
The constructor name of the class
Gets the scalar value as a GLSL-compatible float string.
The scalar value formatted as a GLSL float literal
Gets the scalar value as a GLSL-compatible integer string.
The scalar value formatted as a GLSL integer literal
Gets the scalar value as a GLSL-compatible unsigned integer string.
The scalar value formatted as a GLSL unsigned integer literal with 'u' suffix
Gets the w component (always 1 for scalars).
Always returns 1
Gets the scalar value as a WGSL-compatible float string.
The scalar value formatted as a WGSL float literal
Gets the scalar value as a WGSL-compatible integer string.
The scalar value formatted as a WGSL integer literal
Gets the scalar value as a WGSL-compatible unsigned integer string.
The scalar value formatted as a WGSL unsigned integer literal with 'u' suffix
Gets the x component (scalar value).
The scalar value
Sets the x component (scalar value).
The new scalar value
Gets the y component (always 0 for scalars).
Always returns 0
Gets the z component (always 0 for scalars).
Always returns 0
StaticcompositionGets the component value at the specified index.
The index of the component to retrieve
The component value at the given index
Creates a copy of this scalar.
A new MutableScalard instance with the same value
Copies the components from another scalar to this scalar.
The source scalar to copy from
Calculates the dot product between this vector and another vector.
The dot product result
Gets the scalar value as a number.
The scalar value
Gets the scalar value wrapped in an array.
An array containing the scalar value
Checks if this vector is a dummy (empty) vector. A dummy vector has no components and is typically used as a placeholder.
True if the vector is dummy, false otherwise
Performs approximate equality comparison with another scalar within a tolerance.
The scalar to compare with
The tolerance for comparison (default: Number.EPSILON)
True if the scalars are equal within the specified tolerance
Performs strict equality comparison with another scalar. Uses exact floating-point comparison without tolerance.
The scalar to compare with
True if the scalars are exactly equal, false otherwise
Checks if the internal storage shares the same ArrayBuffer as the provided one. Useful for determining if vectors share underlying memory.
The ArrayBuffer to compare against
True if the same ArrayBuffer is used, false otherwise
Calculates the distance from this vector to another vector.
The distance between the vectors
Sets the scalar value.
The new scalar value
This scalar instance for method chaining
Converts the scalar to a string representation.
A string representation of the scalar in the format "(value)"
Gets the component value at the specified index. Alias for the at() method for convenience.
The index of the component to retrieve
The component value at the given index
Protected Static_ProtectedCreates a dummy (uninitialized) scalar instance.
The typed array constructor to use
A new dummy scalar instance
Protected Static_ProtectedCreates a new scalar instance from a number value.
The numeric value to create the scalar from
The typed array constructor to use
A new scalar instance
StaticdummyCreates a dummy scalar with no data.
A new MutableScalard instance with empty array
StaticoneStaticzero
Mutable scalar class with 64-bit float components. This class provides a mutable scalar value backed by a Float64Array for higher precision.