Helper methods for cartesian conversion.