Four-bar linkage path synthesis: find a linkage that traces your curve
Draw or type the path a point should follow, and this tool searches for four-bar linkages whose coupler point traces it while the crank turns. Each candidate comes with its error measured against your path, the crank angles it uses, its smallest transmission angle and two other linkages that trace exactly the same curve.
It is an approximate search, not a proof: the result is the best it found with the stated settings, and "nothing found" does not mean that no linkage exists. Everything runs in your browser; nothing is uploaded.
Find a linkage for your path
1. Your path
Draw on the grid with a mouse, pen or finger: a new stroke replaces the path. Without drawing, pick a sample or type coordinates below.
Separate x and y with a comma, space, tab or semicolon, and use a point as the decimal mark: two columns pasted from a spreadsheet work. The path runs from the first line to the last. Up to 5,000 points.
2. Search
5 candidates, best first.
The path has changed since these results were found. Run the search again to update them.
Shown for the D shape, computed when this page was built. Turn on JavaScript to enter your own path and run the search.
Selected candidate
The values are kept in the address after #, so a copied link opens the same state. Nothing is sent to the server.
A cognate traces exactly the same path with different links (Roberts–Chebyshev theorem). It is driven by the motion of the original coupler, so its own input link does not always turn fully.
Candidates
The label is only a reading aid for the measured error: close below 0.5 %, approximate below 2 % of the size of your path. It is not a guarantee.
Candidate 1
close- Error (RMS)
- 0.54 mm (0.42 % of path size)
- Largest error at check points
- 1.76 mm (1.38 % of path size)
- Largest stray from your path
- 1.52 mm
- Smallest transmission angle
- 26°
- Type
- crank-rocker
- Size of everything that moves (diagonal)
- 285.8 mm
- Dimensions (mm)
- a 22.53 · b 29.78 · c 193.6 · d 198.3 · u -48.13 · v 8.30
Candidate 2
close- Error (RMS)
- 0.55 mm (0.43 % of path size)
- Largest error at check points
- 2.05 mm (1.60 % of path size)
- Largest stray from your path
- 1.76 mm
- Smallest transmission angle
- 19° (below 20°: the output may bind)
- Type
- crank-rocker
- Size of everything that moves (diagonal)
- 19604.3 mm
- Dimensions (mm)
- a 54.92 · b 18978.3 · c 75.42 · d 18961.9 · u 11597.8 · v -3496.0
Candidate 3
approximate- Error (RMS)
- 0.69 mm (0.54 % of path size)
- Largest error at check points
- 2.32 mm (1.81 % of path size)
- Largest stray from your path
- 1.85 mm
- Smallest transmission angle
- 59°
- Type
- crank-rocker
- Size of everything that moves (diagonal)
- 1926.1 mm
- Dimensions (mm)
- a 59.56 · b 1289.3 · c 159.6 · d 1319.0 · u 1765.4 · v 99.59
Candidate 4
approximate- Error (RMS)
- 0.69 mm (0.54 % of path size)
- Largest error at check points
- 2.04 mm (1.59 % of path size)
- Largest stray from your path
- 1.83 mm
- Smallest transmission angle
- 60°
- Type
- crank-rocker
- Size of everything that moves (diagonal)
- 1548.8 mm
- Dimensions (mm)
- a 59.83 · b 1035.9 · c 157.3 · d 1025.6 · u 1408.7 · v 120.1
Candidate 5
approximate- Error (RMS)
- 0.70 mm (0.54 % of path size)
- Largest error at check points
- 2.10 mm (1.64 % of path size)
- Largest stray from your path
- 2.09 mm
- Smallest transmission angle
- 49°
- Type
- crank-rocker
- Size of everything that moves (diagonal)
- 1038.8 mm
- Dimensions (mm)
- a 58.61 · b 666.6 · c 162.7 · d 632.9 · u 869.0 · v 168.0
Search settings, to repeat the result: closed loop, seed 1, catalogue of 20,000 linkages, 64 fitting points and 128 check points, solver 0.1.0.
Three things to try
- The D shape. A straight stroke with a return arc is a classic job for a four-bar: the search returns 5 candidates, the best within 0.42 % of the size of the path (RMS, worse of fitting and check points). Switch it to a cognate: the same path, drawn by different links.
- Sharp corners. Pick the triangle. A coupler curve is smooth, so a four-bar cannot turn a sharp corner: the best candidate is off by 1.28 %, against 0.03 % for the ellipse. The tool reports this measured error rather than pretending to fit.
- A straight stroke. Pick the 100 mm stroke (an open path of two points). The best candidate follows it to within 0.00 % of the stroke over 122° of crank turn; the rest of the turn is the return, which the search leaves free.
How to read the results
| Item | What it means |
|---|---|
| Error (RMS) | Distance from your path's points to the candidate's curve, as a root mean square, in mm and as a share of the diagonal of your path's bounding box. |
| Largest error at check points | The same distance at points of your path the optimiser never saw. If it is much larger than the RMS error, the fit is worse between the points. |
| Largest stray from your path | Closed loops only: how far the curve wanders where your path does not go. |
| Crank angle along the path | Open paths only: the crank angles at the start and the end of your path, and the direction of turn. |
| Smallest transmission angle | The worst angle between coupler and output link over the turn. Below about 20° the output tends to bind; the card marks it. |
| Size | Diagonal of the box that holds everything that moves, pivots included. |
| Dimensions | a crank, b coupler, c output link, d ground; u and v place the tracing point on the coupler (u along A→B, v to its left). |
The labels "close", "approximate" and "rough" only summarise the measured error (below 0.5 %, below 2 %, above). Candidates with an error below 0.2 % count as equally accurate; among them, a weak transmission angle (and, for open paths, a short crank range or a bulky build) moves a candidate down the list.
How it works
- Catalogue. 20,000 four-bars (for open paths 8,000) are generated from a fixed seed, each with a crank that turns fully and a Grashof margin. They are made on your device each time, so the same seed always gives the same catalogue.
- Shape match. Your path is resampled by arc length. For a loop, low Fourier harmonics that do not depend on position, size, rotation or starting point pick the nearest shapes; for an open path, pieces of every catalogue curve are compared with your path.
- Exact alignment. Each shortlisted linkage is moved, turned, scaled and if needed mirrored onto your path in closed form (Procrustes alignment).
- Refinement. The best 12 are refined with the Levenberg–Marquardt method over the pivot positions, the three link lengths and the tracing point, on 64 fitting points; 128 other points are kept back to check the result.
- Cognates. For every candidate the Roberts–Chebyshev theorem gives two more four-bars with the same coupler curve. A cognate can be easier to build, or fit a space the original does not.
What this tool does not do
- It searches four-bars driven by a fully turning crank only. Rocking inputs and paths that go back and forth along the same line are not searched.
- The timing along the path is free: the tool matches the shape, not how fast the point moves along it.
- For an open path, where the point goes during the rest of the turn is not constrained, so check it against obstacles.
- It is planar kinematics only. Forces, torque, friction, deflection and strength are not computed. Links are lines without thickness, so they may collide in a real build.
To study a result further, open the four-bar linkage experiment and enter its lengths there, or save it as JSON.
How the numbers on this page are produced
Every error is measured afterwards on the candidate's actual coupler curve (256 points), not taken from the optimiser. The examples above are searched when this page is built, with the same engine, seed and settings as the button, and the build stops if a statement in the text no longer matches. Engine version 0.1.0.
Background reading: J. A. Hrones and G. L. Nelson, Analysis of the Four-Bar Linkage (1951), the original atlas of coupler curves; R. L. Norton, Design of Machinery (coupler curves, cognates and path synthesis).