math functions for road generation