| ▲ | Gare 21 hours ago | ||||||||||||||||
> And they are also… a math nightmare. Differential geometry. Integrals. Oh my… Which is probably why most games don’t even dare. Wonder if cubic parabola (used by some railways, and visually near indistinguishable from clothoid) has easier maths. | |||||||||||||||||
| ▲ | Ef996 18 hours ago | parent | next [-] | ||||||||||||||||
Glad you mentioned it. Cubic parabolas were actually used by eraly railway engineers as good approximations of clothoids back when numerically solving a true euler spiral was a daunting task. They are visually very close because their curvature increseases approximately linearly along the curve but not exactly. Mathematically speaking if you wirte the cubic parabola as something like y = kx^3, the second derivative (which give the curvature) grows linearly with x which makes it behave similary in gentle transitions. The problem is that the second derivative is not enough alone for having a true smooth curvature. The real curvature formula has in the denominator the first derivative as well (slope) making it not increase perfectly linearly along the curve. (denominator becomes larger and larger as x incrases) But yeah, cubic parabola is basaically a good enough approximation. Might be a good solution for a system like this. | |||||||||||||||||
| |||||||||||||||||
| ▲ | raphlinus 18 hours ago | parent | prev [-] | ||||||||||||||||
I don't agree that the clothoid is a math nightmare. One of the central problems you have to solve for roads is the offset curve. And a clothoid is extremely unusual in that its offset curve has a clean analytic solution. This won't be the case for the cubic parabola (which is really just a special case of the cubic Bézier). Sure, you have to have some facility with math to use clothoids, but I think the only other curve that will actually be simpler is circular arcs. | |||||||||||||||||
| |||||||||||||||||