Your explanation about the scenario lacks details, especially regarding physics packages (or are you developing one?). In general, defining a sloping terrain can be achieved by creating a height field, which is essentially a rectangular mesh of triangles. You can create an N x M array with different heights and then use Three.js to draw triangles based on these values. The spacing between the triangles can be adjusted according to your terrain detail requirements.
With this setup, determining the three closest points in the mesh relative to a car position becomes quick and easy using JavaScript. By comparing the X and Z components of the car position against the mesh spacing, you can find the nearest points. Adjusting the car's height to match the Y value of the corresponding triangle is straightforward in JS. Additionally, calculating the 3D slope of that location for any physics computations is also simple. Three.js may not even need to be involved directly – all essential information lies within the original terrain array and the 2D-to-3D mapping of the car's position.
This approach is tailored specifically for terrain-related scenarios. If you require collision detection with arbitrary geometry, the complexity level increases significantly.