epsilon
Tolerance for determining minimum or nearly-equivalent lengths for vectors.
static let epsilon: Float
The built-in value for this library is 1e-8
.
Tolerance for determining minimum or nearly-equivalent lengths for vectors.
static let epsilon: Float
where Scalar == Float
The built-in value for this library is 1e-8
.
import Voxels
A Swift library for storage, manipulation, export, and 3D rendering of Voxel data.
import Swift
@frozen struct SIMD3<Scalar> where Scalar : SIMDScalar
A vector of three scalar values.
@frozen struct Float
A single-precision, floating-point value type.
static let zero: SIMD3<Float>
var isNormalized: Bool { get }
A Boolean value indicating that the length of the vector is 1
.
var length: Float { get }
The length of the vector.
var lengthSquared: Float { get }
The square of the length.
func abs() -> Vector
func cross(_ other: Vector) -> Vector
Computes the cross-product of this vector and another you provide.
func distance_squared(_ other: `Self`) -> Float
The squared distance from this vector to another you provide.
func dot(_ another: Vector) -> Float
Computes the dot-product of this vector and another you provide.
func lerp(_ a: Vector, _ t: Float) -> Vector
Linearly interpolate between this vector and another you provide.
func normalized() -> Vector
Returns a normalized vector with a length of one.
func yzx() -> SIMD3<Scalar>
Returns the vector, rewritten and reflected from x, y, z to y, z, x
func zxy() -> SIMD3<Scalar>
Returns the vector, rewritten and reflected from x, y, z to z, x, y