Liking cljdoc? Tell your friends :D

mafs.vec


addclj/s

(add [x1 y1] [x2 y2])

Add two vectors

Add two vectors
sourceraw docstring

distclj/s

(dist v1 v2)

Gets the distance between two vectors

Gets the distance between two vectors
sourceraw docstring

dotclj/s

(dot [x1 y1] [x2 y2])

Dot product of two vectors

Dot product of two vectors
sourceraw docstring

lerpclj/s

(lerp v1 v2 t)

Linear interpolation between two vectors

Linear interpolation between two vectors
sourceraw docstring

magclj/s

(mag v)

Get the magnitude of a vector

Get the magnitude of a vector
sourceraw docstring

midpointclj/s

(midpoint v1 v2)

Gets the midpoint of two vectors

Gets the midpoint of two vectors
sourceraw docstring

normalclj/s

(normal [x y])

Get the normal vector of a vector

Get the normal vector of a vector
sourceraw docstring

normalizeclj/s

(normalize v)

Return a normalized version of a vector

Return a normalized version of a vector
sourceraw docstring

rotateclj/s

(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.
sourceraw docstring

rotate-aboutclj/s

(rotate-about v cp a)

Rotates a vector around a given point.

Rotates a vector around a given point.
sourceraw docstring

scaleclj/s

(scale [x y] sc)

Scale a vector by a scalar

Scale a vector by a scalar
sourceraw docstring

square-distclj/s

(square-dist [x1 y1] [x2 y2])

Get the square distance between two vectors

Get the square distance between two vectors
sourceraw docstring

subclj/s

(sub [x1 y1] [x2 y2])

Subtract one vector from another

Subtract one vector from another
sourceraw docstring

transformclj/s

(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.
sourceraw docstring

with-magclj/s

(with-mag v m)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close