Plane and spherical trigonometry