How this calculation works
Find a minimum-radius enclosing cylinder for a finite set of three-dimensional points when the axis direction is fixed. Projecting onto the perpendicular plane reduces the radius problem to a smallest enclosing circle, while axial extremes determine the height. The page reports axis, center, cap centers, support points, radius, height and volume. It does not optimize the axis direction.
Project perpendicular to fixed unit axis n; minimum projected enclosing circle gives cylinder radius, axial extrema give cap positions.A worked example
The eight points are cardinal unit-circle positions at z=0 and z=2. A fixed z-axis direction gives radius one, height two, center (0,0,1) and volume 2π. This radius is optimal for that fixed direction; a free-axis minimum-volume cylinder is a different optimization problem.
Good to know
1–40 spatial points; nonzero fixed direction. Complete projected support-set search and numerical containment checks. Radius/center approximate, orientation fixed. Degenerate zero radius/height allowed; no unrestricted-axis or minimum-volume optimality claim.
Fixing direction makes the problem tractable
A free-axis minimum enclosing cylinder is a different and harder optimization problem. Here the supplied nonzero direction is normalized, and only the axis’s perpendicular position is optimized.
Every point is decomposed into an axial coordinate and a perpendicular-plane position. Changing the direction can change both radius and height. The result is optimal for the entered direction, not a certificate that no cylinder with another tilt would be smaller.
Returns a cylinder for spatial points and a fixed orientation, including its axis and axial extent; does not optimize a free spatial direction. The Bezier curve intersection calculator from two control polygons offers a complementary calculation under its own stated assumptions.
Projection determines the radius
Distance to any axis parallel to the fixed direction equals planar distance from the projected point to the axis’s projected center. A smallest enclosing circle of those projections therefore supplies the minimum possible radius.
In two dimensions such a circle has a support set of at most three points. The bounded implementation examines support candidates and checks enclosure, rather than using the three-dimensional bounding-box diagonal as a radius estimate.
Worked example and mathematical rule
The eight points are cardinal unit-circle positions at z=0 and z=2. A fixed z-axis direction gives radius one, height two, center (0,0,1) and volume 2π. This radius is optimal for that fixed direction; a free-axis minimum-volume cylinder is a different optimization problem.
Project perpendicular to fixed unit axis n; minimum projected enclosing circle gives cylinder radius, axial extrema give cap positions.
Axial extremes determine the caps
The smallest and largest dot products along the axis determine the minimum finite height needed to contain the points. The reported center uses the midpoint of that interval, with cap centers at its extremes.
Moving the axis center along its own direction does not change perpendicular point distances, but the cap convention fixes a useful finite-cylinder placement. Height zero is possible when every point lies in one plane perpendicular to the direction.
Radius optimality and volume
With direction fixed, the axial extent is independent of the perpendicular center, so minimizing radius also minimizes volume for the stated cap placement. A radius-zero result occurs when all points lie on a common line parallel to the axis.
Such degenerate cylinders are valid geometric limits, though they are not physical containers with wall thickness. The tool encloses points only; it does not account for objects extending between or beyond the sampled points unless their geometry is otherwise known.
Numerical stability and support witnesses
Perpendicular coordinates are computed through an orthonormal basis, avoiding subtraction of nearly equal squared three-dimensional lengths. Support points identify which projections determine the circle, but several equivalent supports can exist.
All points are checked against the selected radius within tolerance. Large coordinate offsets with tiny local spread can still lose precision before projection, so translate data to a sensible origin and retain enough significant digits in the input.
A reproducible enclosure audit
Normalize the direction, recompute each point’s axial coordinate and perpendicular distance, and verify both cap range and radius. Translating the point set should translate the cylinder without changing radius or height.
Reversing axis direction swaps cap ordering but preserves the same geometric cylinder. Adding points cannot reduce the required radius or height for that fixed direction. Use the result for bounded point-cloud geometry, not a manufacturing clearance certification or a free-orientation packing optimum.
A few questions, answered
Is the axis direction optimized?
No. The result is minimum-radius only for the supplied fixed direction.
Why does a circle solve the radius problem?
Perpendicular distance to parallel axes is exactly planar distance after projection.
Can height or radius be zero?
Yes for degenerate point configurations.
Does reversing the direction change the cylinder?
It changes orientation and cap order, but not its radius or height.