(dist v1 v2)
Gets the distance between two vectors
Gets the distance between two vectors
(dot [x1 y1] [x2 y2])
Dot product of two vectors
Dot product of two vectors
(lerp v1 v2 t)
Linear interpolation between two vectors
Linear interpolation between two vectors
(midpoint v1 v2)
Gets the midpoint of two vectors
Gets the midpoint of two vectors
(normal [x y])
Get the normal vector of a vector
Get the normal vector of a vector
(normalize v)
Return a normalized version of a vector
Return a normalized version of a vector
(rotate [x y] a)
Rotates a vector around the origin. Shorthand for a rotation matrix.
Rotates a vector around the origin. Shorthand for a rotation matrix.
(rotate-about v cp a)
Rotates a vector around a given point.
Rotates a vector around a given point.
(square-dist [x1 y1] [x2 y2])
Get the square distance between two vectors
Get the square distance between two vectors
(sub [x1 y1] [x2 y2])
Subtract one vector from another
Subtract one vector from another
(transform [x y] [a c tx b d ty])
Apply a matrix transformation to a vector. This is a 3x3 matrix applied to a 2d vector, like M*v.
Apply a matrix transformation to a vector. This is a 3x3 matrix applied to a 2d vector, like M*v.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close