constants - blossommerz/locus-hub GitHub Wiki

Home > Constants & unit conversions

< Previous: Lists & collections | Next: Overview >

The Nodes Window

Constants & unit conversions

Named values you can drop straight into the node graph - math constants and millimeter <-> working-unit conversions - just by typing their name.

In the node palette, type a constant's name and press Enter: Locus drops a Number node holding that value, named after the constant. The names are fuzzy-matched, so a few letters find them (gold -> goldenAngle, mmto -> the mm-to-unit family). See Adding & connecting nodes for the quick-entry palette.

Math constants

Name Value Notes
pi 3.14159... π
tau 6.28319... 2π - a full turn; tau / N divides the circle into N
e 2.71828... Euler's number
phi 1.61803... the golden ratio
sqrt 2 1.41421...
sqrt 3 1.73205...
sqrt 5 2.23607...
silver 2.41421... the silver ratio, 1 + sqrt 2
goldenAngle 137.50776 degrees in degrees, matching Rotate's Angle

Unit-conversion constants

Because node numbers are always millimeters, these constants convert to and from your working unit. Multiply a value by one to move it across units.

Name Value Use
intomm 25.4 inches -> mm
mmtoin 0.03937... mm -> inches
fttomm / mmtoft 304.8 / 0.00328... feet <-> mm
mtomm / mmtom 1000 / 0.001 meters <-> mm
sqintosqmm / sqmmtosqin 645.16 / 0.00155... square inches <-> mm2

The same four (length both ways, area both ways) exist for every non-mm unit, and any new unit added to the app gets its set automatically.


Examples

goldenAngle - a phyllotaxis scatter

A phyllotaxis sunflower scatter - points placed at successive 137.5 degrees turns, radius growing with the square root of the index

Place each item goldenAngle further round than the last and the turns never line up - the even, non-repeating spread that packs a sunflower. Node setup: Series -> Math x goldenAngle (the angles) and Math ^ 0.5 x spacing (the radii) -> Point: Polar -> Place. Full walkthrough on the Phyllotaxis page.

tau - even N-fold symmetry

A dart rotated by tau over 6 into a clean six-fold rosette

A full turn is tau, so tau / N divides the circle into exactly N - no typing 60 and hoping. Node setup: Number tau -> Math (/ 6) -> Rotate (Angle from the result, Repeat 6, Center at the origin) -> a clean six-fold rosette.

mmtoin - working in inches

A 25.4 mm value multiplied by mmtoin gives 1.00 in

The node graph is always in millimeters; multiply a value by mmtoin to read or export it in inches (intomm goes the other way, sqmmtosqin for areas). Node setup: the value -> Math (x mmtoin).

< Previous: Lists & collections | Next: Overview >

Related

⚠️ **GitHub.com Fallback** ⚠️