Click the images for detail.
The racing line is calulated by simulating the behavior of a flexible strip confined to the road.
The skew parameter is used to avoid artefacts on sharp curves.