I am looking to get angle between two hexagonal planes. I have coordinates of all 12 vertices (2 hexagons). Is there anyway I can find the angle between the planes. And also I have the information about the centers of each hexagonal plane.
You can see the two hexagons, I need to find the angle between them
Having six coordinates actually makes the problem harder, because it's over-determined. Are these empirical measurements with some systematic noise? Is it possible that the rings are somewhat bent? If the answer is either question is yes, then you probably want to take some kind of average using all six points, rather than randomly choosing three and ignoring the other three.
Here's one way to find the normal vector of a plane fit to a point cloud: https://math.stackexchange.com/a/99317/87023
Edit: If you insist on assuming that the points lie on the same plane, then it's enough to choose three points. I still recommend using all six points, though. You can take the normal vector to points 1, 3, and 5, and also take the normal vector to points 2, 4, and 6. You expect these normals to be parallel, but if they're slightly off, then you can average them together, and treat that average as the normal to the hexagon. This procedure is ad-hoc but simple, and it has the advantage that it doesn't depend on where you start the labeling.
Once you have two normal vectors, you can use their dot product to compute the angle between them: https://math.stackexchange.com/a/654331/87023