Liking cljdoc? Tell your friends :D

mafs.vec


addcljs

(add [x1 y1] [x2 y2])

Add two vectors

Add two vectors
sourceraw docstring

distcljs

(dist v1 v2)

Gets the distance between two vectors

Gets the distance between two vectors
sourceraw docstring

dotcljs

(dot [x1 y1] [x2 y2])

Dot product of two vectors

Dot product of two vectors
sourceraw docstring

lerpcljs

(lerp v1 v2 t)

Linear interpolation between two vectors

Linear interpolation between two vectors
sourceraw docstring

magcljs

(mag v)

Get the magnitude of a vector

Get the magnitude of a vector
sourceraw docstring

midpointcljs

(midpoint v1 v2)

Gets the midpoint of two vectors

Gets the midpoint of two vectors
sourceraw docstring

normalcljs

(normal [x y])

Get the normal vector of a vector

Get the normal vector of a vector
sourceraw docstring

normalizecljs

(normalize v)

Return a normalized version of a vector

Return a normalized version of a vector
sourceraw docstring

rotatecljs

(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-aboutcljs

(rotate-about v cp a)

Rotates a vector around a given point.

Rotates a vector around a given point.
sourceraw docstring

scalecljs

(scale [x y] sc)

Scale a vector by a scalar

Scale a vector by a scalar
sourceraw docstring

square-distcljs

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

Get the square distance between two vectors

Get the square distance between two vectors
sourceraw docstring

subcljs

(sub [x1 y1] [x2 y2])

Subtract one vector from another

Subtract one vector from another
sourceraw docstring

transformcljs

(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-magcljs

(with-mag v m)
source

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

× close