a math library for the clumsy and curious π
yarn add clumsy-math
a recursive euclid spacer where each layer has a point at the zero slot
const baseEuclidMap = [true, true, false, true, false]
const terminalEuclidMap = [true, false, true]
const resultEuclidMap = [true, false, false, true, false]
a euclid spacer that has an orientation and phase of zero (default layout) (most left dense)
const euclidMapA = [true, true, false, true, false] // basic
const euclidMapB = [true, false, true, false, true] // not basic
const euclidMapC = [true, false, true, true, false] // not basic
a recursive euclidean spacer of a recursive euclidean spacer
const baseComponentMap = [true, true, false, true, false]
const interposedComponentMap = [true, false, false, true, false]
const terminalComponentMap = [true, false, false, false, false]
a basic euclid spacer that is reduced to its simplest form
const fullEuclidMap = [true, false, true, false]
const coreEuclidMap = [true, false]
a spacer whose points are as evenly distributed as possible throughout a discrete space
const euclidMapA = [true, true, false, true, false]
const euclidMapB = [true, false, true, false, true]
const euclidMapC = [true, false, true, true, false]
a recursive euclid spacer where all of the individual layers are phaseable
const baseEuclidMap = [true, true, false, true, false]
const terminalEuclidMap = [false, true, true]
const resultEuclidMap = [false, true, false, true, false]
a spacer where euclid spacers are stacked on top of one another such that the base spacer's density / points determines the next spacer's resolution / space
const baseEuclidMap = [true, true, false, true, false]
const terminalEuclidMap = [true, true, flase]
const resultEuclidMap = [true, true, false, false, false]
a discrete sequence / cycle of binary values (slots)
const spacerString = "1010"
const spacerMap = [true, false, true, false];
const spacer = {
resolution: 4,
points: [0, 2]
}
the number of points in a spacer
const spacerMap = [true, true, false, true, false]
const spacerPoints = [0, 1, 3]
const spacerDensity = 3 // spacerPoints.length
a set of aligned recursive euclidean spacers that share a static base structure and a dynamic member structure where the density structure is the same but orientations are different
const groupBase = [true, true, false, true, false]
const groupMapsA = [
[true, true, false, true, false],
[true, false, false, true, false],
]
starting at a base point, the distance upto the next point
const spacerMap = [true, true, false, true, false]
const spacerPoints = [0, 1, 3]
const spacerIntervals = [1, 2, 2]
all spacer groups an aligned recursive euclidean spacer belongs to
const spacerMapA = [true, false, false, true, false]
const lineageMapsA = [
[
[true, true, false, false, false],
[true, false, false, true, false],
[true, false, true, false, false],
[true, false, false, false, true],
[true, false, true, false, false],
[true, false, false, true, false],
],
[
[true, true, false, false, false],
[true, false, false, true, false],
],
];
the offset of an aligned spacer, measured in points, relative to a base spacer
const baseSpacerMap = [true, true, false, true, false]
const spacerOrientation = 2
const reorientedSpacerMap = [true, false, true, true, false]
the offset of a spacer, measured in slots, relative to a base spacer
const baseSpacerMap = [true, true, false, true, false]
const spacerPhase = -1; // spacerMap.length
const phasedSpacerMap = [false, true, true, false, true]
the index of a slot whose value is true (1)
const spacerMap = [true, true, false, true, false]
const spacerPoints = [0, 1, 3]
a point's corresponding slot weight
const spacerMapA = [true, true, false, true, false]; // 1, 1, 0, 1, 0
const spacerMapB = [true, false, true, false, true]; // 1, 0, 1, 0, 1
const spacerMapC = [true, false, true, true, false]; // 1, 0, 1, 1, 0
const groupSlotWeights = [3, 1, 2, 2, 1];
const spacerPointsA = [0, 1, 3]
const spacerPointWeightsA = [3, 1, 2]
a point whose value is normalized within the range of [0, 1)
const spacerMap = [true, true, false, true, false]
const spacerPoints = [0, 1, 3]
const relativeSpacerPoints = [0.0, 0.2, 0.6]
the number of slots constituting a spacer
const spacerMap = [true, true, false, true, false]
const spacerResolution = 5; // spacerMap.length
the building block of spacer
const spacerMap = [true, true, false, true, false]
const spacerSlotZero = spacerMap[0] // true
const spacerSlotTwo = spacerMap[2] // false
the sum of points at a slot across a set of spacers with the same resolution
const spacerMapA = [true, true, false, true, false]; // 1, 1, 0, 1, 0
const spacerMapB = [true, false, true, false, true]; // 1, 0, 1, 0, 1
const spacerMapC = [true, false, true, true, false]; // 1, 0, 1, 1, 0
const groupSlotWeights = [3, 1, 2, 2, 1];
const slotWeightZero = 3; // groupSlotWeights[0]
the sum of a spacer's point weight
const spacerMapA = [true, true, false, true, false]; // 1, 1, 0, 1, 0
const spacerMapB = [true, false, true, false, true]; // 1, 0, 1, 0, 1
const spacerMapC = [true, false, true, true, false]; // 1, 0, 1, 1, 0
const groupSlotWeights = [3, 1, 2, 2, 1];
const spacerPointsA = [0, 1, 3]
const spacerPointWeightsA = [3, 1, 2]
const spacerWeightA = 6 // 3 + 1 + 2
encoding for defining a AlignedRecursiveEuclidSpacerStructure layer's components
ergonomic encoding for defining aligned recursive euclid spacer
compressed alias for AlignedRecursiveEuclidSpacerStructure
encoding for defining a PhasedRecursiveEuclidSpacerStructure layer's components
ergonomic encoding for defining phased recursive euclid spacer
compressed alias for PhasedRecursiveEuclidSpacerStructure
useful encoding for either AlignedRecursiveEuclidSpacerStructure or PhasedRecursiveEuclidSpacerStructure
a real number in the range of [0, 1)
defacto encoding for working with spacer
an integer in the range of [0, spacerResolution]
encoding for defining the base structure of a SpacerGroupStructure
encoding for defining the member structure of a SpacerGroupStructure
ergonomic encoding for defining spacer group
an integer in the range of [1, spacerResolution]
spacer as Array<boolean>
an integer in the range of [0, spacerDensity)
an integer in the range of (-spacerResolution, spacerResolution)
an integer in the range of [0, spacerResolution)
an integer in the range of [0, β)
an integer in the range of [1, β)
a boolean that's either true or false
an integer in the range of [0, β)
spacer as a string of 1's and 0's
an integer in the range of [0, β)
great for working with euclid spacers where orientation and phase are not needed
const basicSpacerA = basicEuclidSpacer(5, 3)
// basicSpacerA === [5, [0, 1, 3]]
great for destructuring a spacer structure into its constituent spacers
const componentsA = spacerComponents([5, [3, 1, 0], [2, 0, 0]])
// const componentsA === [
// [5, [3, 1, 0]], // baseSpacerStructure
// [5, [3, 1, 0], [2, 0, 0]]
// ]
most important spacer function, but rarely invoked by itself
const coreSpacerMapA = coreEuclidMap(5, 3)
// coreSpacerMapA === [true, true, false, true, false]
great for working with simplified euclid spacers
const coreSpacerA = coreEuclidSpacer(8, 4)
// coreSpacerA === [2, [0]]
great for working with unlayered euclid spacers
const spacerA = euclidSpacer(5, 3, 1, 0)
// spacerA === [5, [0, 2, 4]]
great for reorienting an aligned spacer after it's been created
const spacerA = spacer(5, [3, 1])
const spacerB = orientatedSpacer(spacerA, 1)
// spacerB === [5, [0, 2, 3]]
great for phasing a spacer after it's been created
const spacerA = spacer([5, [3, 1]]),
const spacerB = phasedSpacer(spacerA, 1)
// spacerB === [5, [1, 3, 4]]
great for normalizing spacers across different resolutions
const relativePointsA = relativeSpacerPoints(
spacer([5, [3, 1]])
)
// relativePointsA === [0, 0.4, 0.8]
primary function for working with spacer
const spacerA = spacer([5, [3, 1, 0]])
// const spacerA === [5, [0, 2, 4]]
great for normalizing a spacer and it's orientations against itself
spacerFullSlotWeights(
spacer([5, [3, 0]]),
) // [3, 1, 2, 2, 1]
great for defining a set of related spacers at a desired altitude / scope
const groupA = spacerGroup([[5], [3]])
// groupA === [
// [5, [3, 0]],
// [5, [3, 1]],
// [5, [3, 2]]
// ]
great for logging and working with datasets of spacer groups
const groupIdA = spacerGroupId([[5, [3, 1]], [2]])
// groupIdA === "group___5__3_1___2"
great for logging and working with datasets of spacer structures
const idA = spacerId([5, [3, 1, 0]])
// const idA === "phased__5__3_1_0"
great for making calculations between spacer points
const intervalsA = spacerIntervals(
spacer([5, [3, 1]])
)
// intervalsA === [2, 2, 1]
great for getting related spacers at a given altitude / scope / lineageIndex
const lineageA = spacerLineage([5, [3, 1], [2, 0]])
// lineageA === [
// [[5], [3, 2]], // high-altitude or zoomed-out
// [[5, [3, 1]], [2]] // low-altitude or zoomed-in
// ]
great for working with a spacer's points in the context of a set of spacers
const pointWeightsA = spacerPointWeights(
spacerSlotWeights([
spacer([5, [3, 0]]),
spacer([5, [3, 1]]),
spacer([5, [3, 2]])
]),
spacer([5, [3, 2]])
)
// const pointWeightsA === [3, 2, 2]
great for understanding point distribution across a set of spacers
const slotWeightsA = spacerSlotWeights([
spacer([5, [3, 0]]),
spacer([5, [3, 1]]),
spacer([5, [3, 2]])
])
// slotWeightsA === [3, 1, 2, 2, 1]
great for logging and visualizing short spacers
const stringA = spacerString(
spacer([5, [3, 1]])
)
// stringA === "10101"
great for differentiating a spacer against a set of spacers
const weightA = spacerWeight(
spacerSlotWeights([
spacer([5, [3, 0]]),
spacer([5, [3, 1]]),
spacer([5, [3, 2]])
]),
spacer([5, [3, 2]])
)
// const weightA === 7
a natural number greater than one whose factors are one and itself
const prime = 5 // 5 * 1
const notPrime = 4 // 2 * 2, 4 * 1
a natural number where both it's immediate neighbors are prime
const containerA = 6 // 5 & 7
const containerB = 12 // 11 & 13
the set of primes bounded by adjacent prime containers
use for checking if some number is prime
isPrime(4) // false
isPrime(5) // true
use for checking if some number is a prime container
isPrimeContainer(4) // true
isPrimeContainer(5) // false
great for rounding some number to nearest prime
nearestPrimes(1) // [null, 2]
nearestPrimes(3) // [3, 3]
nearestPrimes(8) // [7, 11]
use for getting prime by index
prime(0) // 2
prime(1) // 3
prime(2) // 5
great for organizing primes and who knows what else
primeContainer(0) // 4
primeContainer(1) // 6
primeContainer(2) // 12
use for working with the first n prime containers
primeContainerSequence(2) // [4, 6, 12]
use for working with the first n primes
primeSeqeunce(2) // [2, 3, 5]
use for getting all primes less than some number
primeSequenceInclusive(6) // [2, 3, 5]
great for working with primes between containers
primeSequenceInRange(12, 18) // [13, 17]
great for working with primes that share bounds and analyzing prime distribution
primeTribe(0) // [5]
primeTribe(1) // [7, 11]
primeTribe(2) // [13, 17]
great for analyzing the layout of a prime tribe
tribeSpacer(2) // [6, [0, 4]]
tribeSpacer(3) // [12, [0, 4, 10]]
tribeSpacer(4) // [12, [0, 6, 10]]
prime as number
prime container as number
great for generating cosine waves of a loop
great for generating pendulum waves of a loop
great for rendering geometry and synthesizing waves
great for generating sine waves of a loop