VectorN
is an n-dimensional vector data type. Its implementation is array-backed.
angle-between
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) b)] (Maybe a))
(angle-between a b)
Get the angle between two vectors a and b.
anti-parallel?
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) b)] (Maybe Bool))
(anti-parallel? a b)
Check whether the two vectors a and b are anti-parallel.
dist
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) c)] (Maybe a))
(dist a b)
Get the distance between the vectors a and b.
dot
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) c)] (Maybe a))
(dot x y)
Get the dot product of the two vectors x and y.
parallel?
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) b)] (Maybe Bool))
(parallel? a b)
Check whether the two vectors a and b are parallel.
perpendicular?
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) b)] (Maybe Bool))
(perpendicular? a b)
Check whether the two vectors a and b are perpendicular.
update-n
(Fn [(VectorN a), (Ref (Fn [Int] Int b) c)] (VectorN a))
updates the n property of a (VectorN f) using a function f.
update-v
(Fn [(VectorN a), (Ref (Fn [(Array a)] (Array a) b) c)] (VectorN a))
updates the v property of a (VectorN f) using a function f.
vlerp
(Fn [(Ref (VectorN a) b), (Ref (VectorN a) c), a] (Maybe (VectorN a)))
(vlerp a b amnt)
Linearly interpolate between the two vectors a and b by amnt (between 0 and 1).
zip
(Fn [(Fn [a, b] c d), (Ref (VectorN a) e), (Ref (VectorN b) f)] (Maybe (VectorN c)))
(zip f a b)