§27's vortex: a purely tangential swirl around the line through center
along axis.
â = axis / |axis| (normalized at construction)
r = position − center
r∥ = (r · â) â (component along the axis)
r⊥ = r − r∥, d = |r⊥| (distance from the axis)
t = â × r = â × r⊥, |t| = d
a = strength · (t / d) / max(d, minDistance)
so the magnitude is |strength| / max(d, minDistance) — inverse-distance,
one power gentler than radialField — and the direction is â × r̂⊥,
a unit vector perpendicular to both the axis and r. Two properties follow
exactly (both pinned by the tests):
a · â = 0 — nothing is pushed along the axis;
a · r = 0 — no radial component, so a vortex alone neither sucks
particles in nor throws them out. Pair it with radialField for an
inward spiral; that separation is the reason the two are distinct fields.
Handedness follows the right-hand rule: with axis = +Y, a particle at
+X is pushed toward −Z (ŷ × x̂ = −ẑ), i.e. counter-clockwise when viewed
from +Y looking down at the XZ plane in a right-handed Y-up world (§7a).
Negate strength to reverse it.
On the axis (d === 0) the tangent is undefined, so the field contributes
(0, 0, 0).
RangeError if any component of center or axis, or strength, or
options.minDistance, is not finite; if minDistance <= 0; or if axis has
zero length (unlike a cone direction, a vortex has no sensible default axis).
§27's vortex: a purely tangential swirl around the line through
centeralongaxis.so the magnitude is
|strength| / max(d, minDistance)— inverse-distance, one power gentler than radialField — and the direction isâ × r̂⊥, a unit vector perpendicular to both the axis andr. Two properties follow exactly (both pinned by the tests):a · â = 0— nothing is pushed along the axis;a · r = 0— no radial component, so a vortex alone neither sucks particles in nor throws them out. Pair it with radialField for an inward spiral; that separation is the reason the two are distinct fields.Handedness follows the right-hand rule: with
axis = +Y, a particle at+Xis pushed toward−Z(ŷ × x̂ = −ẑ), i.e. counter-clockwise when viewed from+Ylooking down at the XZ plane in a right-handed Y-up world (§7a). Negatestrengthto reverse it.On the axis (
d === 0) the tangent is undefined, so the field contributes(0, 0, 0).