jjant/linear-algebra/1.0.0

Vec4

type alias Vec4 =
{ x : Float
, y : Float
, z : Float
, w : Float
}

Create

vec4 : Float -> Float -> Float -> Float -> Vec4

Create a vector out of its x, y, z, and w components.

Setters

The set functions create a new copy of the vector, updating a single field.

setX : Float -> Vec4 -> Vec4
setY : Float -> Vec4 -> Vec4
setZ : Float -> Vec4 -> Vec4
setW : Float -> Vec4 -> Vec4

Constants

zero : Vec4

Operations

add : Vec4 -> Vec4 -> Vec4
sub : Vec4 -> Vec4 -> Vec4
negate : Vec4 -> Vec4
scale : Float -> Vec4 -> Vec4
dot : Vec4 -> Vec4 -> Float
normalize : Vec4 -> Vec4
{ from : Vec4
, to : Vec4
}
-> Vec4
length : Vec4 -> Float
lengthSquared : Vec4 -> Float
distance : Vec4 -> Vec4 -> Float
distanceSquared : Vec4 -> Vec4 -> Float
toString : Vec4 -> String