Hacker Newsnew | past | comments | ask | show | jobs | submit | Gare's commentslogin

> 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.


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.


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.


I mean they are not a math nightmare per se if you’re comfortable with the theory. What I meant is that they become comparatively complex to integrate into a system like this. Think about arc length, compute intersections, reparametrization, etc., and with clothoids that usually means some complex numerical algorithms.

Using circular arcs or even simple third-degree polynomials (like cubic parabolas) reduces many of those operations to trivial O(1) function calls, which makes them much cheaper to evaluate and manipulate procedurally, especially when you're computing it 60 times per frame


You might be familiar with these, but GP wrote a couple of excellent pieces on Euler spirals:

https://raphlinus.github.io/curves/2021/02/19/parallel-curve...

https://levien.com/phd/euler_hist.pdf


This collision happened precisely because of unfortunate circumstance that break in the rail and derailment happened just before the switch leading to the opposite track. Without the "help" of the switch, carriages of the first train likely wouldn't have invaded the second track.


The tracks are less than 3m from each other, a derailed car doesn’t need to get very far to be a risk to incoming traffic.


Well, they could add speakers that make vroom-vroom noises.


> Well, they could add speakers that make vroom-vroom noises.

And you could have typed this comment into notepad and saved it on a file on your desktop, but instead you shared it with a world that considers it irrelevant.

See? We all do useless things.


The Falcons have all three engines tail mounted, so not the same "type" of trijet as MD-11.


AFAIK it should be a different system because the car asks the key first (same system as Keyless GO).


Well, AI is plain wrong. Fuel cutoff switches on Airbus are in the same position as in Boeing planes, below the throttle.


Technically, 2 EU countries: Greece and Cyprus.


Right but back then Cyprus was not an EU member.


True, but that EU regulation is based on the ground truth of much less spacious roads and cities.


Not quite. Originally, the tighter length limits were intended to give trucks a disadvantage compared to freight trains. But engine technology caught up and more efficient smaller engines negated that limitation.


Not really. A regular truck & trailer is way too big to fit in space-constrained city centers. When it gets really tight they'll just send a box truck, often with a trailer they can leave behind outside the city center for some extra capacity when it's a multi-stop trip [0]. The fancy ones even have doors in the front of the trailer, making it quite easy to move freight from the trailer into the box truck itself.

On the other hand, the highway infrastructure has plenty of space for large trucks. If the roads to & from the main highway network can handle it, some countries will give you permits for all sorts of fancy combinations[1] up to 83 ft long. Considering that it'll still be pulled with a regular cab-over truck, that's a lot of space for freight. They are now even trialing the "Super EcoCombi", which is essentially two full semi-trailers[2], for a total of 105 ft!

[0]: https://assets-global.website-files.com/6424195493a93d7e7fe4...

[1]: https://nl.wikipedia.org/wiki/Langere_en_Zwaardere_Vrachtaut...

[2]: https://i0.wp.com/www.curbsideclassic.com/wp-content/uploads...


You might consider it an eyesore, but the river is hardly ruined by it.


Fortunately, JS is getting Temporal, which will be great. No such thing on the horizon for Python yet.


Well, there's libraries like this one, which is the point here.

And even in JS, Temporal won't be available broadly for a good while yet (it will probably be rolling out in Firefox in a couple of months' time, but in Safari it's still behind a feature flag, and I don't think there's even a feature-flagged implementation for Chrome yet). In the meantime, it makes sense to use a polyfill — again a library.

By all means choose your dependencies wisely, but the point I'm trying to make is that very often a sensible use of dependencies will reduce your technical debt, and attempting to use bad approaches to complex topics just because they're built into the standard library will cause so many problems down the line.


I fully agree with that. Just a bit disappointed that Python is not even considering to fix/replace it's problematic datetime library (as far as I know). Excellent third-party library is good, but an excellent standard library is even better!


Maybe this is the first step toward that future.

In Temporal's case, it takes significant inspiration from several existing datetime libraries in Javascript. Those were all stepping stones (among others) that led to Temporal.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: