Liking cljdoc? Tell your friends :D

had-utils.math


add-vectorsclj

(add-vectors v1 & vs)

Add two or more vectors of numbers of the same dimension

Add two or more vectors of numbers of the same dimension
sourceraw docstring

average-vectorsclj

(average-vectors v1 v2)
(average-vectors v1 v2 w)

Average vectors v1 and v2. If w is supplied then make a weighted average where v1 has weight w and v2 weight 1-w. One can also think of this as the midpoint of two points.

Average vectors `v1` and `v2`. If `w` is supplied then
make a weighted average where `v1` has weight `w` and
`v2` weight `1-w`. One can also think of this as the midpoint
of two points.
sourceraw docstring

digits->numclj

(digits->num digits)
(digits->num digits base)

Convert the sequence of digits into a number. Can specify base (default 10).

Convert the sequence of `digits` into a number. Can specify `base` (default 10).
sourceraw docstring

gcdclj

(gcd a b)

Find the greatest common denominator of a and b. Always return a non-negative number.

Find the greatest common denominator of `a` and `b`.
Always return a non-negative number.
sourceraw docstring

invert-vectorclj

(invert-vector v)

Multiply vector by -1

Multiply vector by -1
sourceraw docstring

l1-distanceclj

(l1-distance p1 p2)

Find the l1 distance between points p1 and p2

Find the l1 distance between points `p1` and `p2`
sourceraw docstring

lcmclj

(lcm a b)

Find the least common multiple of a and b, both positive.

Find the least common multiple of `a` and `b`, both positive.
sourceraw docstring

linf-distanceclj

(linf-distance p1 p2)

Find the l-infinity distance between points p1 and p2

Find the l-infinity distance between points `p1` and `p2`
sourceraw docstring

mod-opclj

(mod-op lb ub op arg1 arg2)

Find (op arg1 arg2) and use put-into-range to make the result between lb and ub inclusive.

Find `(op arg1 arg2)` and use `put-into-range` to make the result between `lb` and `ub` inclusive.
sourceraw docstring

num->digitsclj

(num->digits n)
(num->digits num base)

convert a number n into a sequence of digits. Can specify base (default 10).

convert a number `n` into a sequence of digits. Can specify `base` (default 10).
sourceraw docstring

put-into-rangeclj

(put-into-range lb ub n)

Find the number in range lb to ub (inclusive) to which n is equivalent mod ub-lb+1. Assumes lb < ub and everything is an integer.

Find the number in range `lb` to `ub` (inclusive) to which `n` is equivalent mod `ub`-`lb`+1.
Assumes `lb` < `ub` and everything is an integer.
sourceraw docstring

rayclj

(ray point dir)

Starting at and including point a collection of points moving in steps given by dir.

Starting at and including `point` a collection of points
moving in steps given by `dir`.
sourceraw docstring

ray-segmentclj

(ray-segment n point dir)

the first n points on the ray defined by point and dir

the first `n` points on the ray defined by `point` and `dir`
sourceraw docstring

scale-vectorclj

(scale-vector v x)

Scale the vector v by a factor of x

Scale the vector `v` by a factor of `x`
sourceraw docstring

subtract-vectorsclj

(subtract-vectors v1 v2)

Subtract two vectors of numbers of the same dimension

Subtract two vectors of numbers of the same dimension
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close