intermediate

#13 Polar Coordinates

Radial patterns and spirals

Polar coordinates describe a point by its distance from the center (radius) and its angle, instead of x and y. Convert with length() for radius and atan() for angle. This coordinate system makes radial patterns effortless — modulate the radius by the angle using sin() or cos() to create flowers, stars, and gear-like shapes. Offset the angle with distance to produce spirals. Anything that radiates from a center point is easier to express in polar coordinates.

Key Concepts

Try this shader live in the Shader Sandbox editor with real-time preview.
Open in Sandbox

Source Code


    
← Previous Color Spaces Next → Domain Repetition

All Tutorials