(add v1 v2)
adds two vectors of same dimension together
adds two vectors of same dimension together
(add-scalar v scalar)
Adds a scalar to a vector
Adds a scalar to a vector
(angle-between v1 v2)
Calculates the angle between two 2D Vectors using angle difference.
Calculates the angle between two 2D Vectors using angle difference.
(distance v1 v2)
Calculates distance between two vectors of same dimension
Calculates distance between two vectors of same dimension
(div v1 v2)
Divides one vector by another. Both must be same dimension.
Divides one vector by another. Both must be same dimension.
(div-scalar v scalar)
Divides vector by a scalar
Divides vector by a scalar
(from-angle theta)
Returns a 2D unit vector with given angle
Returns a 2D unit vector with given angle
(from-polar theta radius)
Returns a 2D vector from polar coordinates
Returns a 2D vector from polar coordinates
(length v)
Returns the length of a vector of any dimension.
Returns the length of a vector of any dimension.
(limit v l)
If vector v is bigger than limit l, vector gets scaled to l.
If vector v is bigger than limit l, vector gets scaled to l.
(mul v1 v2)
Multiplied two vectors of same dimensions
Multiplied two vectors of same dimensions
(mul-scalar v scalar)
Multiplies vector by a scalar
Multiplies vector by a scalar
(normalize v)
Returns a vector of any dimension normalized
Returns a vector of any dimension normalized
(random N)
Returns a random vector of N dimension. Values between 0 and 1.
Returns a random vector of N dimension. Values between 0 and 1.
(random-polar)
returns a 2D vector from a random angle and radius between 0 and 1
returns a 2D vector from a random angle and radius between 0 and 1
(rotate v theta)
rotates a 2D vector by an angle
rotates a 2D vector by an angle
(set-length v l)
Returns the vector v with given length l.
Returns the vector v with given length l.
(sub v1 v2)
Substracts 2 vectors of same dimension
Substracts 2 vectors of same dimension
(sub-scalar v scalar)
Subtracts scalar from vector
Subtracts scalar from vector
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close