liveBook · Manning

Partial derivative

As explained in Geometry for Programmers

A partial derivative is the derivative of a multivariable function with respect to one variable while the other variables are held constant.

A partial derivative measures how a function of several variables changes along one chosen axis while the other variables act as parameters. For a function of x and y, differentiate by x, by y, or compute both separately. The separate results become especially useful when combined into a gradient vector. section 11.3.2

The gradient points toward the function’s greatest increase at a point. Moving against it can pull a contour vertex toward an isoline; comparing neighboring gradients can also reveal sharp features, whose tangent lines guide vertex placement. section 11.3.2 section 11.4.1

For smooth contour construction, partial derivatives supply endpoint tangent information:

  • Measure dx and dy at each endpoint of a line segment in an SDF or interpolated image. section 11.4.1 section 12.4.4
  • Use endpoint positions and derivative values as equations for the x and y cubic coefficients. section 11.4.1
  • Normalize tangent vectors when gradient magnitudes are out of scale; their derivative ratio preserves direction, while excessive magnitude can create loops. section 12.4.4

From a segment to a smooth cubic

Given endpoints (x0, y0) and (x1, y1), take partial derivatives dx0, dy0, dx1, and dy1. With t running from 0 to 1, endpoint equations fix the cubic’s position and its derivative equations fix its tangents. Shared derivative measurements at a shared point yield C1 continuity; second partial derivatives can extend the construction toward C2 continuity with fifth-degree polynomials. section 11.4.1 section 11.6

>>> diff(y**3 + x**2 + 3*y + 4, x)   #1
>>> diff(y**3 + x**2 + 3*y + 4, y)   #2

Compare symbolic differentiation of the same two-variable expression with respect to x and with respect to y. section 11.3.2

How Geometry for Programmers covers it

How deep it goes
Defines separate differentiation by coordinate, then uses derivative values in gradients, tangent equations, and continuity extensions.
Examples
Uses a two-variable polynomial, SDF contour vertices, cubic segment equations, and raster-image vectorization.
What it assumes
Assumes familiarity with compound functions while introducing coordinate-specific differentiation and its notation.
What you can do after
Apply it via SymPy and derivative-based equations to construct and stabilize smooth contour segments.
How it connects
Connects partial derivatives with gradients, signed distance fields, tangent vectors, cubic interpolation, and continuity.

Also explained in

Compare how 3 books explain partial derivative →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.