gaussBell

A bell curve: 1 at zero, falling toward 0 on both sides.

gaussBell(x: Expr, k: Val): Expr

Import math from shaders/std and use math.gaussBell.

k sets the width. Larger values give a narrower bell. Pass a distance or a centered coordinate as x.

Parameters

NameTypeNotes
xExpr
kVal

Example

const profile = gaussBell(div(beam.across, beamWidth), 2.5)

See also

  • exp — e raised to the value.
  • smoothstep — A soft edge: 0 below e0, 1 above e1, an S-curve between.

Used by

Prism, Waveform