# Internal (Z-Matrix) to Cartesian coordinates conversion

Is there any way to convert from Internal to Cartesian coordinates using simple formulas?

I have studied and implemented: INTERNAL TO CARTESIAN by Jack D. Kunitz.

But somehow the x, y and z values are not correct. I am not implementing the transformation back to the initial frame as it says, because I do not understand that step. Is that the reason for not being able to get correct answers or is this not a good tutorial or solution to follow.

• The link you have provided returns 403 (forbidden) - it cannot be accessed. You might consider quoting the relevant information from the material you linked in your question to avoid problems relating to linking content in the future. Jul 28 '16 at 15:35
• I added the original DOI to the link. It's a BASIC implementation of Internal to Cartesian from 1995. Jul 28 '16 at 15:45

Sure, it's just trigonometry. There are a variety of open source implementations.

For example:

There are dozens in a search on GitHub if you don't like C++ or Python.

There's also a web app from Shodor for z-matrix conversion.

• I have just one more question: If I have (x y z) coordinates at first. Then I change them to Internal coordinates. And then I change them back to (x y z) coordinates, what is the possibility that the new (x y z) coordinate points are EXACTLY the same as the 1st ones up to 4 floating points. Or in other words... Is it okay if they are not that similar. e.g. if I had a point in x=3.1455 and the new point is at x=3.4398. Is that acceptable? Aug 5 '16 at 7:32
• It's highly unlikely for the Cartesian coordinates to be identical. For example, the first atom will usually be placed at 0.0, 0.0, 0.0, regardless of the initial position. What matters is not the Cartesian frame of reference, but the relative positions between the atoms. Aug 5 '16 at 13:42
• Lets just say I can move the first three atoms of the new molecule to be at the exact same place as the old one. Still is it unlikely that they will be different? Or lets assume that the first atom (coıncidentally) was placed at (0, 0, 0). the second atom at (x, 0, 0) and the third one also perfectly and coincidentally placed at the right spot. Assuming this, will the molecule be EXACTLY identical to the previous one or still it might have some floating point errors? Aug 5 '16 at 13:55
• OR in other words, will the relative positioning be EXACTLY the same upto... lets say... three or four floating point numbers. for example: old position = (3.14556, 6.3434, 9.9594) and new position = (3.1459, 6.3439, 9.9560) Aug 5 '16 at 13:59
• No there will often be floating point issues even if the orientation is exactly consistent. Aug 5 '16 at 14:51