Given two points and angles, how can I calculate the connection between the two points in the form of a straight line and a circular arc?
Context of the question: I am trying to make a program that converts a model railway layout created in XtrkCAD into a SCARM layout (scarm.info). Both design applications have a different approach, and a different way of saving the layout to a file. Luckily both use a human readable text file format.
XtrkCAD knows the concept of the easement or transition curve, but SCARM doesn't. When converting a layout I now get gaps in the track where XtrkCAD had an easement. When I close that gap using SCARM, it creates a piece of track consisting of a straight part and a circular curve.
The following image shows an example. A straight track (length 50) has to be connected to a curved track (radius 276, angular length 56.5 degrees). The red track created by SCARM is a straight track of length 56, followed by a curved track with radius 360 and an angular length of 16.8 degrees.
What I would like to know is how I can calculate the straight track and the curved track, based on the end points of the two pieces of track that should be connected and their angles.