There is always another can of worms.
The simple bit is this: There is a load of different labelling schemes for the three axes and traditionally, computer graphics people have migrated from 2D elevation view where Y is up to 3D where Z is that new dimension. Amazingly enough, positive Z is nearer to the viewer, or south in RW. Z sorting is when the graphics engine decides what you see (among various objects in a view of sight).
The formulas arrive from two different sources and Kuju know why.
Basically, the ideal clothoid
In engineering practice, people like to draw precise stuff on paper. So they needed formulas that lent themselves to do that. The above method did not.
One popular approximation is the cubic parabola, nicely explained
here together with a little background on superelevation. The original formula is
y = x³ / 6 / L / R
with R the radius at the end, L the total length, and x the horizontal position.
However, Kuju positively measured x along the track, not along the horizontal axis.
For the end of the curve, x = L so it becomes the formula I showed. Don't ask me if I messed up there, but when you draw an easement in many segments (by clicking the mouse every 10 m or so), you get exactly the figures I showed.
I called the Y in the formula X to suit the other formula. I also called the length measured along the track s in keeping with the other formula (it does not have a name in the formula of the cubic parabola).
Note that now you are at a loss as to the other dimension - y. Input: s = running length, output: x = position along the horizontal axis. The original formula used x as input and y as output, implying s because it is irrelevant when you draw on paper.
I agonized over the missing dimension for a few years and then came across some American tests containing the other formula.
Then I came across the other formula. It was in some
American text book from 1901 downloaded from archive.org. I just found it in the whole mess: Page 82, formula 56. Note that this is the chapter on street railways ... Anyway, I am truly glad to have found it again. I was sure I never made up such a thing, but in all the stuff that piles up on my harddisk it, so to say, it is not easy to spot the justification for each of my believes.
Please, don't get lost in this book. By the time you sussed out all the units of all the variables, you have plotted all the easements in RW in your map, and people would rather see that. And while it is great fun to read how people went about the task a century ago, it does not help you in a computer game at all.