Three-dimensional vector type.
Construct a vector from x, y, and z coordinates.
The zero vector. zero == vector 0 0 0
Alias for zero.
Normal vector along the x axis.
xAxis == vector 1 0 0Normal vector along the y axis.
yAxis == vector 0 1 0Normal vector along the z axis.
zAxis == vector 0 0 1Get the x component of a vector.
getX (vector 1 2 3) == 1Get the y component of a vector.
getY (vector 1 2 3) == 2Get the z component of a vector.
getZ (vector 1 2 3) == 3Returns true when two vectors are about equal (within 10^-5).
Add two vectors.
Subtract two vectors.
Negate a vector.
Multiply a vector by a number.
Compute the dot product of two vectors.
Compute the cross product of two vectors.
Return the unit vector that points in the same direction as the given vector. Return Nothing if given the zero vector.
normalize (vector 0 3 0) == Just (vector 0 1 0)
normalize (vector 0 0 0) == Nothing
normalize (vector 1 1 1) == Just (scale (1/sqrt 3) (vector 1 1 1))Length of a vector. Always greater than or equal to zero.
Square of the length of a vector.
Return the unit vector that points from the second vector to the first vector. Return Nothing if the vectors are the same.
direction (vector 1 1 0) (vector -1 1 0) == Just (vector 1 0 0)
direction a b == normalize (a `sub` b)Distance from one vector to another. Always greater than or equal to zero.
direction (vector 1 1 0) (vector -1 1 0) == 2
direction a b == length (a `sub` b)Square of the distance between two vectors.
Convert a 3-tuple to a vector.
fromTuple (1, 2, 3) == vector 1 2 3Convert a vector to a 3-tuple.
toTuple (vector 1 2 3) == (1, 2, 3)Convert a vector into a Json Value.
A Json Decoder for vectors encoded with encode.
Convert from an elm-linear-algebra Vec3
Convert to an elm-linear-algebra Vec3
Vector is just a type alias for a record.