Discovering Revs at the core of The Sentinel's maths routines
Before writing The Sentinel, Geoff Crammond released Revs, the first proper racing simulator and the grandfather of modern sim racing. Not surprisingly, Revs contains an awful lot of maths routines, and you can read all about them in my site containing the fully documented source code for Revs on the BBC Micro.
What is perhaps more surprising is that the core maths routines from Revs also power The Sentinel. Sure, Revs is heavy on the applied maths, with its physics models and engine simulations, but the track geometry is all about angles and vectors; after all, applied maths is essentially pure maths that's been applied to the real world. The Sentinel is all about pure maths and doesn't simulate anything physical, but the underlying concept of pitch and yaw angles is ported from Revs with hardly any changes, and as a result, so is the clever equirectangular screen projection system that these angles imply.
In terms of the projection system, this isn't so much about shared code as shared concepts. But those concepts are so key to the way that the Sentinel's scrolling landscape works, that I think it's fair to say that The Sentinel uses the graphics engine from Revs, even though the implementations are different (the screen buffer system in Revs is definitely not the same as the screen buffer system in The Sentinel, for example). For more information on the graphical similarities between the two games, see the deep dive on the projection system.
Here's a complete list of routines in The Sentinel that are originally from Revs:
To avoid variable names clashing, the variables G and H from Revs have been renamed to G2 and H2 in The Sentinel, but the routine is otherwise the same. The variable J has been ported across as well, as this isn't used by The Sentinel, but all other variables are shared between the two.
Note that in carrying across the commentary from Revs, I've left the name of the GetRotationMatrix routine alone. For the calculations in The Sentinel we don't need a full rotation matrix, but the Revs routine still calculates the values that we do need, namely sin(vectorPitchAngle), cos(vectorPitchAngle), sin(vectorYawAngle) and cos(vectorYawAngle). I could have renamed this routine for The Sentinel to something like GetSinAndCos16, as all it does is calculate the sine and cosine to 16-bit accuracy, but I've left the Revs code alone as much as possible to show the influence of Geoff Crammond's previous game.
Also, because this routine comes from Revs, where it is only used to rotate through the driver's yaw angle, I have renamed the result variables from sinYawAngle and cosYawAngle to sinAngle and cosAngle, as The Sentinel uses the routine to rotate through both yaw angles and pitch angles. To keep things simple the commentary still refers to yaw angles, but the calculations apply equally to pitch angles.