Nonlinear grid transformations
Any layout in Gridfunction can be bent: graph paper into a wave, polar paper into a swirl, a photo into a fisheye. This guide explains the coordinates, the built-in presets and how to write your own math function, in x′ and y′, in polar form or as a complex function f(z).
Where to find it
In the generator, open Nonlinear transformation in the settings. Pick a preset or Custom math function, then adjust Strength, Frequency and Phase. Apply to chooses what bends: the grid and image together, the grid only, or an added image only. The preview, the PDF, the PNG, the SVG and the printed page all use the same transformation, and lines stay as smooth vectors in the PDF and SVG.
The coordinate system
- The origin is the center of the grid area, inside your margins.
xincreases to the right andyincreases upward, as on a math graph.- Coordinates are scaled so the shorter half-side of the grid area is 1. On a portrait page, x runs from −1 to 1 and y runs a little past ±1.3.
ris the distance from the center andthetais the angle in radians, measured counterclockwise from the positive x axis.- The sliders are available as
a(strength),b(frequency) andc(phase, in radians).
A transformation moves every point (x, y) on the original paper to a new point (x′, y′). Leaving x′ = x and y′ = y gives the unchanged page.
Built-in presets
| Preset | What it does |
|---|---|
| Wave | Pushes lines sideways along sine waves. Frequency sets how many waves fit across the page. |
| Fisheye | Magnifies the center. Negative strength shrinks it instead. |
| Signed logarithmic | Stretches the middle and compresses the edges on a logarithmic curve; negative strength does the opposite. |
| Radial ripple | Circular ripples spreading from the center, like a drop in water. |
| Swirl | Rotates the center more than the edges, twisting the grid. |
| Barrel | Bulges the page outward toward the corners, like a wide-angle lens. |
| Pinch / bulge | Pulls lines toward the center or pushes them away. |
| Radial power | Rescales distance from the center by a power, so spacing grows or shrinks steadily outward. |
| Nonlinear shear | Slides rows sideways more and more toward the top and bottom edges. |
Writing your own math function
Choose Custom math function, then pick how to write it under Write it as. The Examples menu fills in a working function for each style that you can then edit. Formulas are read by a small math parser built into the page; they are never run as code.
- x′ and y′: one formula for the new x and one for the new y.
- Polar, r′ and θ′: one formula for the new distance from the center and one for the new angle in radians.
r′ = randθ′ = 2*thetaopens the page like a fan;θ′ = theta + a*(1 - r)twists it. - Complex, w = f(z): each point is the complex number z = x + iy and moves to f(z). This draws the classic pictures of complex analysis:
z^2turns the grid into two families of parabolas,exp(z)into circles and rays,(z + 1/z)/2is the Joukowski map. Because these maps are conformal, the bent squares keep their right angles.
Examples to try (x′ and y′)
| Effect | x′ = | y′ = |
|---|---|---|
| Gentle wave | x + 0.05*sin(6*pi*y) | y |
| Slider-controlled wave | x + a*sin(b*pi*y + c) | y |
| Ripples | x*(1 + 0.06*sin(12*r)) | y*(1 + 0.06*sin(12*r)) |
| Twist (use Strength) | r*cos(theta + a*(1 - r)) | r*sin(theta + a*(1 - r)) |
| Log scale across | sign(x)*log(1 + 9*abs(x)) | y |
| Soft edges | tanh(2x)/tanh(2) | tanh(2y)/tanh(2) |
What you can use
- Operators:
+ - * / ^and parentheses. Writing2xor3(x+1)means multiplication. - Constants:
pi,e,tau. - Functions:
sin cos tan asin acos atan atan2 sinh cosh tanh sqrt cbrt abs exp ln log log10 log2 pow min max hypot sign round floor ceil clamp mod. logis base 10 andlnis the natural logarithm.- In complex mode:
zandi, and the functionssin cos tan sinh cosh tanh exp ln log sqrt pow abs arg conj re im. Writei*zor2i;izis read as one unknown name. Square roots and logarithms use their principal branch, so lines break where they cross the negative real axis.
If a formula has a mistake, the message under the formula boxes says what is wrong and the page shows the unbent grid until it is fixed.
Images
When you add an image under Add an image, it is cut into a fine mesh of triangles and every triangle is moved by the same transformation as the grid, so the picture bends with the lines. Set Apply to to Image only to bend just the picture over a straight grid, or Grid only to keep the picture flat. Images stay on your device.
Tips
- Small numbers go a long way: amplitudes between 0.02 and 0.1 give clear but gentle effects.
- Points that would move absurdly far, or that produce an undefined value such as the square root of a negative number, are skipped and the line breaks there.
- Strong transformations can push lines past the margins. Anything outside the margins is trimmed.
- A bent grid has no squares left to measure, so turn on Size-check ruler if the printed scale matters. The ruler is never bent.
- Check the result before printing a large batch; the preview shows exactly what will print.