Vector2
is a two-dimensional vector data type.
angle-between
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] a)
(angle-between a b)
Get the angle between two vectors a and b.
anti-parallel?
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] Bool)
(anti-parallel? a b)
Check whether the two vectors a and b are anti-parallel.
dist
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] a)
(dist a b)
Get the distance between the vectors a and b.
dot
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] a)
(dot a b)
Get the dot product of the two vectors x and y.
parallel?
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] Bool)
(parallel? a b)
Check whether the two vectors a and b are parallel.
perpendicular?
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] Bool)
(perpendicular? a b)
Check whether the two vectors a and b are perpendicular.
rotate
(Fn [(Ref (Vector2 a) b), a] (Vector2 a))
(rotate a n)
Rotate the vector a by the radians n.
update-x
(Fn [(Vector2 a), (Ref (Fn [a] a b) c)] (Vector2 a))
updates the x property of a (Vector2 f) using a function f.
update-y
(Fn [(Vector2 a), (Ref (Fn [a] a b) c)] (Vector2 a))
updates the y property of a (Vector2 f) using a function f.
vapprox
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c)] Bool)
(vapprox a b)
Check whether the vectors a and b are approximately equal.
vlerp
(Fn [(Ref (Vector2 a) b), (Ref (Vector2 a) c), a] (Vector2 a))
(vlerp a b amnt)
Linearly interpolate between the two vectors a and b by amnt (between 0 and 1).