Function

simd_normalize(_:)

Returns a vector pointing in the same direction of the supplied vector with a length of 1.

Declaration

func simd_normalize(_ __x: simd_float4) -> simd_float4

See Also

Geometry Functions

func simd_dot(simd_float4, simd_float4) -> Float

Returns the dot product of two vectors.

func simd_project(simd_float4, simd_float4) -> simd_float4

Returns the first vector projected onto the second vector.

func simd_precise_normalize(simd_float4) -> simd_float4

Returns the precise normalized vector.

func simd_fast_normalize(simd_float4) -> simd_float4

Returns the fast normalized vector.

func simd_distance_squared(simd_float4, simd_float4) -> Float

Returns the square of the distance between two vectors.

func simd_length(simd_float4) -> Float

Returns the length of a vector.

func simd_length_squared(simd_float4) -> Float

Returns the square of the length of a vector.

func simd_norm_inf(simd_float4) -> Float

Returns the inf-norm (the maximum absolute value) of a vector.

func simd_norm_one(simd_float4) -> Float

Returns the one-norm (the sum of absolute values) of a vector.

func simd_refract(simd_float4, simd_float4, Float) -> simd_float4

Returns the refraction direction of an incident vector, a unit normal vector, and an index of refraction eta.

func simd_reflect(simd_float4, simd_float4) -> simd_float4

Returns the reflection direction of an incident vector and a unit normal vector.