This paper derives explicit solutions for Riemannian and sub-Riemannian curves on non-Euclidean spaces of arbitrary constant cross-sectional curvature. The problem is formulated in the context of an optimal control problem on a 3-D Lie group and an application of Pontryagin’s maximum principle of optimal control leads to the appropriate quadratic Hamiltonian. It is shown that the regular extremals defining the necessary conditions for Riemannian and sub-Riemannian curves can each be expressed as the classical simple pendulum. The regular extremal curves are solved analytically in terms of Jacobi elliptic functions and their projection onto the underlying base space of arbitrary curvature are explicitly derived in terms of Jacobi elliptic fu...