# Translate 2D point to 3D coordinate system

I have a bunch of points in a 3D coordinate system that approximates a circle. I'm able to find the best-fitting plane of the points, and then find a 2D coordinate system in that plane, using the answer for this question: 2D Coordinates of Projection of 3D Vector onto 2D Plane

When I have the new 2D coordinate system e'1, e'2 (can also be described in 3D by just adding the normalvector of the plane as a Z-axis), I'm able to find the best-fitting-circle to the points. This gives me a correct radius, and a circle center point. Now I would like to plot this circle in the original 3D coordinate system. How can I translate the circle center point that is now described in e'1, e'2-coordinates, back to x, y, z-coordinates?

I've tried with rotation matrixes but no luck

• – borgerodsjo Feb 17 '15 at 14:38

You have a centre point $X$, vectors $\vec{r_1}$ and $\vec{r_2}$, that marks radius and two axes of the plane (i.e. that are perpendicular to each other and both to the normal of the plane), than you'll have the formula for points on the circle is $$Y = X + \cos(\phi)\vec{r_1} + \sin(\phi)\vec{r_2}$$ for $\phi \in <0, 2\pi)$