Using PostGIS, how do I work out the end point of an arc given the start point, start and end bearings (relative to true north) and radius of the arc? Eg. say I need draw an arc of 4000m radius from bearing 180 degrees to 90 degrees with the start (the 180 degree point) at POINT(10 20). How do I calculate the end point (other than approximately drawing the arc, point by point)?
This is only for short distances, so working on a plane should be OK. I can work out the distance between the start and end point using the length of chord formula and if I could just get the bearing between them as well then I could use ST_Project - but I don't know how to work out the bearing. (In the simple example above it should be 45 degrees.)
It ended up being quite simple in the end. Thanks to whuber for explaining it very well. I wanted to put the PostGIS code here in case anyone else wants it:
centre_point := ST_Project(start_point, radius_m, normalise_angle(start_angle + pi() / 2 * CASE WHEN is_clockwise THEN 1 ELSE -1 END)); end_point := ST_Project(centre_point, radius_m, normalise_angle(end_angle + pi() / 2 * CASE WHEN is_clockwise THEN -1 ELSE 1 END));
normalise_angle is a simple function that ensures the angle is between 0 and 2PI (as required for ST_Project),
start_point is a
radius_m is the radius in metres. Angles are in radians.