# The original way of mutual transformation of ecliptic and equatorial coordinates

Are you tired of transforming coordinates in 3D space using rotation matrices and other quaternions? I understand you perfectly, and I myself have spent more than one hour of my life doing this tiresome occupation. But it seems that your and my torment has come to an end – I managed to find a simple and intuitive method that allows you to significantly simplify this difficult task.

As a matter of fact, to begin with, let’s pay attention to the well-known Cartesian coordinate system (personally, out of old habit, I call it “normal”). It is known to be related to the equatorial coordinates of the stars by simple relationships:

And here is the image for clarity:

So far, everything is familiar, right?

And now let’s move on to what, in fact, is novelty. Let’s say we have Cartesian coordinates, and from them we need to calculate the equatorial or even ecliptic coordinates. What usually happens? Boring and painstaking work, in which many make mistakes – welcome to calculations with the tan2 function with a large number of conditions. Once I got tired of all this, or rather, I got tired of it, and I came up with a way by which, knowing only three values ​​of X, Y and Z, you can accurately determine the angles of the equatorial or ecliptic systems using the following algorithm:

Do not rush to smile indulgently and mentally pat me on the shoulder: they say, you are a dreamer, buddy, where is there without tan2 … But I have repeatedly carried out similar calculations in Excel, and the method really works great, no matter how strange it may seem at first glance. Do not just forget to convert degrees to radians, and radians to degrees where necessary. Take a look for yourself:

 α δ X Y Z α * δ * 0 thirty 0.866 0.000 0.5 0 thirty thirty thirty 0.750 0.433 0.5 thirty thirty 60 thirty 0.433 0.750 0.5 60 thirty 90 thirty 0.000 0.866 0.5 90 thirty 120 thirty -0.433 0.750 0.5 120 thirty 150 thirty -0.750 0.433 0.5 150 thirty 180 thirty -0.866 0.000 0.5 180 thirty 210 thirty -0.750 -0.433 0.5 210 thirty 240 thirty -0.433 -0.750 0.5 240 thirty 270 thirty 0.000 -0.866 0.5 270 thirty 300 thirty 0.433 -0.750 0.5 300 thirty 330 thirty 0.750 -0.433 0.5 330 thirty 360 thirty 0.866 0.000 0.5 360 thirty

What happens next? I need to find ecliptic coordinates, that is, go to a coordinate system that is still Cartesian, but already “rotated” (again, out of habit, I call it that way).
This will not be difficult at all.

Let’s perform the transformation of Cartesian vectors using well-known formulas.

Convert ecliptic coordinates to equatorial coordinates:

Converting Equatorial Coordinates to Ecliptic Coordinates:

When we end up with three Cartesian ecliptic coordinates, we simply turn to the algorithm described above, and we get the ecliptic coordinates of the luminary λ and β (instead of α and δ). That, in fact, is all. Are you interested? Now try it yourself and see for yourself.