home/ atoms/ hydra-chain-order-non-commutative

Hydra transform order matters — `.rotate().kaleid()` differs from `.kaleid().rotate()`

Hydra transforms are applied in the order they appear in the chain and are not commutative. Geometry transforms (rotate, scale, scroll) and color ops act on different things depending on order: a color op after a geometry transform acts on the warped image, while before it acts on the source. .rotate().kaleid() kaleidoscopes a rotated image; .kaleid().rotate() rotates the kaleidoscoped image — distinct results. A common mistake is placing .color()/.saturate() reflexively at the end when they were meant to act before a geometric transform.

Examples

osc(4).rotate(0.5).kaleid(6).out(o0) // kaleid after rotate osc(4).kaleid(6).rotate(0.5).out(o0) // rotate after kaleid — different

Assessment

Without running the code, describe the visual difference between noise(3).rotate(1.5).kaleid(4).out(o0) and noise(3).kaleid(4).rotate(1.5).out(o0).

“Transforms apply in written order and are **not** commutative. `.rotate().kaleid()` ≠ `.kaleid().rotate()`. Color ops after geometry act on the warped image; before, on the source.”
context/ · L1-instruments/hydra/gotchas.md · chunk 1