Fix calculation of directions from thetas

Fix sign errors in phis
θ, φ calculate direction relative to straight line between segment endpoints