What is the specification for an algorithm which takes as input an array of coordinates (lat/lon) representing a route on map and a distance argument, outputting the coordinates of a polygon surrounding the route at the given distance? I am interested in the math required to calculate the polygon points and how things such as line segments which join at a very acute angle are handled. Related questions which do not produce the answer I am looking for (algorithm specification / equations):
https://stackoverflow.com/questions/7685633/length-buffer-around-polyline
How to create a Polygon around a Linestring as a GeoFence in C# .NET