# Curved path on a sphere

I'm writing a code that constructs a road network a sphere. Building the network is done by:

1. Roads are added using spherical coordinates. A straight road is defined by start and end coordinates, and a up direction vector ((0, 0, 1) in spherical coordinates).
2. To allow the road network to be converted to 3D cartesian coordinates, all roads are segmented into sections with a length much shorter than the radius of the sphere. By segmenting a road, I mean replacing it with multiple shorter road pieces.
3. All coordinates and normals are then converted into 3D cartesian coordinates.

This works well for straight roads. However, I'm struggling with adding road bends. A bend would have an additional angle associated with it. A 90 degree bend would be a quarter circle, and a 180 degree bend a half circle etc. I can't figure out how to segment a road bend on a spherical surface.

Concretely, given two points on the surface of a sphere specified in spherical coordinates, and an angle a, how do I generate a set of points that if projected onto a map would trace the path of a road bend with angle a.

• Don't you also need the radius of the bend as well? – Q the Platypus Aug 15 '19 at 1:52
• @prinsen You did not respond in a while. I gave the differential equation of small circles above. They are not helices. Appreciate if you can please share how it helped in your civil construction work. – Narasimham Nov 18 '19 at 15:48

*Small circles with bend radius $$R_g$$ on sphere radius R *
where $$R_g$$ is radius of bend, and $$(R,\phi,\theta)$$ are in spherical coordinates. $$\psi$$ is variable reference angle your path makes to sphere meridian.
$$\sin \psi\cdot \big(\sin \phi +\frac {d\psi}{d\theta}\big)= \frac{R \cos \phi}{R_g}$$