(add v1 v2)
adds two vectors of same dimension together
adds two vectors of same dimension together
(clamp n lower upper)
(distance v1 v2)
Calculates distance between two vectors of same dimension
Calculates distance between two vectors of same dimension
(dx->x start list)
From a list of intervals, create a list.
For example: [1 1 1] -> [0 1 2 3] [1 2 3] -> [0 1 3 6]
From a list of intervals, create a list. For example: [1 1 1] -> [0 1 2 3] [1 2 3] -> [0 1 3 6]
(length polyline)
Returns the length of a polyline.
Returns the length of a polyline.
(lengths polyline)
Returns the lengths between each vertex of a polyline. The size of the output is N-1.
Returns the lengths between each vertex of a polyline. The size of the output is N-1.
(lengthv v)
Returns the length of a vector of any dimension.
Returns the length of a vector of any dimension.
(lerp polyline t)
Returns a point on the polyline at t (float between 0-1).
Returns a point on the polyline at t (float between 0-1).
(lerpn a b t)
(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
(normalize-range list)
Divides every element in vector by total sum
Divides every element in vector by total sum
(normals polyline)
(pad-end vector value)
(pad-end vector value pad-size)
pads end of vector with value and pad size
pads end of vector with value and pad size
(pad-start vector value)
(pad-start vector value pad-size)
pads start of vector with value and pad size
pads start of vector with value and pad size
(pad-wrap vector)
pads start of vector with end and end of vector with start
pads start of vector with end and end of vector with start
(resample-by-count polyline n)
Resamples the polyline evenly
Resamples the polyline evenly
(resample-by-length polyline len)
Resamples the polyline by a length
Resamples the polyline by a length
(scale n start1 stop1 start2 stop2)
scales a number to a new range
scales a number to a new range
(smooth polyline size & closed)
Returns a smoothed polyline. The size indicates how many verices to the left and right of each vertex to take when smoothing. This is a basic rolling average of a line. Optional third argument indicates if line is wrapped.
Returns a smoothed polyline. The size indicates how many verices to the left and right of each vertex to take when smoothing. This is a basic rolling average of a line. Optional third argument indicates if line is wrapped.
(sub v1 v2)
Substracts 2 vectors of same dimension
Substracts 2 vectors of same dimension
(within-range range num)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close