Mathematical Curves You Can Create with SVG Paths

Scalable Vector Graphics (SVG) paths provide a robust set of drawing commands capable of rendering precise mathematical geometries directly in the browser. This article covers the fundamental mathematical curve types natively supported by the SVG <path> specification—including linear functions, quadratic Béziers, cubic Béziers, and elliptical arcs—as well as advanced mathematical curves that can be synthesized by chaining these base commands together.

Natively Supported Mathematical Curves

The SVG path specification directly supports three primary families of parametric and geometric curves using dedicated path data commands:

1. Linear Curves (First-Degree Polynomials)

Linear curves represent straight line segments between two points in a two-dimensional Cartesian plane. While not curved in the traditional sense, they represent degree-1 polynomial curves defined by the linear equation \(y = mx + b\) or parametric form \(P(t) = (1 - t)P_0 + tP_1\).

2. Quadratic Bézier Curves (Second-Degree Polynomials)

A quadratic Bézier curve is a second-order parametric polynomial curve determined by three points: a start point, a single control point, and an end point. The control point dictates the direction and curvature of the curve without the path actually passing through it. Mathematically, it is defined as:

\[B(t) = (1 - t)^2 P_0 + 2(1 - t)t P_1 + t^2 P_2 \quad \text{for } t \in [0, 1]\]

Geometrically, every quadratic Bézier curve is an exact segment of a parabola.

3. Cubic Bézier Curves (Third-Degree Polynomials)

Cubic Bézier curves are third-order parametric curves defined by four points: a start point, two independent control points, and an end point. These curves allow for inflection points, meaning the curve can change its concavity (e.g., forming S-curves or loops). Mathematically, it is defined as:

\[B(t) = (1 - t)^3 P_0 + 3(1 - t)^2 t P_1 + 3(1 - t)t^2 P_2 + t^3 P_3 \quad \text{for } t \in [0, 1]\]

4. Elliptical and Circular Arcs (Conic Sections)

SVG includes native support for arcs, which are segments of an ellipse or circle. An elliptical arc is defined by the semi-major axis, semi-minor axis, an x-axis rotation angle, and boolean flags determining whether to traverse the large arc and the sweep direction.

Derived Mathematical Curves Constructible with SVG Paths

Curves that do not have dedicated single-letter commands can still be constructed or closely approximated by combining native SVG path primitives:

Composite Splines (B-Splines, Catmull-Rom, Hermite)

By chaining multiple C (cubic) or Q (quadratic) commands together, you can construct piecewise polynomial splines. Non-uniform rational B-splines (NURBS), Hermite splines, and Catmull-Rom splines can be analytically converted into equivalent cubic Bézier segments with matching control points and knots.

Conic Sections (Parabolas, Hyperbolas, Ellipses)

Transcendental and Trigonometric Curves

Transcendental curves cannot be represented as single polynomial equations, but they are constructed in SVG by dividing the curve domain into segments and fitting cubic Bézier segments: