View all expressions
Motion

Procedural Sine Wave Line Expression

Uses a sine function across many points, with sliders for wave height, wavelength and total length, then draws the path.

Contributed by:


amp = effect("Amplitude")("Slider"); // wave height (px)
wavelength = effect("Wavelength")("Slider"); // px per cycle
l = effect("Length")("Slider"); // total wave length (px)
ptsCount = 200;  // change this up if you need even smoother curves
pts = [];
cycles = l / wavelength;
for (i = 0; i < ptsCount; i++) {
 t = i / (ptsCount - 1);
 x = t * l - l / 2;
 y = amp * Math.sin(t * cycles * 2 * Math.PI);
 pts.push([x, y]);
}
createPath(pts, [], [], false);

Procedural Sine Wave Line Expression

Practical use case

Like Wave effect but way better. Quickly generate wavy lines for backgrounds, audio visualizers or motion-graphic flourishes.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image