You are missing information necessary to solve the problem. You need to define the directions of 2D_X and 2D_Y (without this information the idea of 2D coordinates makes no sense).

There are a few different ways to do what you want, but perhaps the easiest way is to actually make things slightly more complicated by introducing a 2D_Z.

Let 2D_X, 2D_Y and 2D_O be (three dimensional) vectors describing the directions of the x, y axis and the origin of the plane in the world coordinates of the 3d space it lives in. So given 2d coordinates (a,b) this would translate into 3d world coordinates given by the components of the vector

a 2D_X + b 2D_Y + 2D_O

We can create a 2D_Z vector which is perpendicular to both 2D_X, and 2D_Y, by taking the cross product of 2D_X and 2D_Y. Now we can represent positions anywhere in 3d space using our new "2D" coordinate system. So (a,b,c) in our new system represents the position

a 2D_X + b 2D_Y + c 2D_Z + 2D_O

in our old system. So now our problem is simply one of changing between two 3d coordinate systems, because we have A in our old coordinate system and we want to know its coordinates in our new system (at which point we can throw away its "z-coordinate" to get the 2d coordinates we actually want).

I'm sure there are lots of tutorials online that will show you how to solve this, and if you are using a 3d library/engine then it probably already has a builtin way of doing this for you. For completeness I'll explain how you can do this since it is not too hard.

Recall that (a,b,c) in our new system represents the position

a 2D_X + b 2D_Y + c 2D_Z + 2D_O

in our old system. This can be more simply represented using matrices. Let M be a 3 by 3 matrix whose columns are 2D_X, 2D_Y, and 2D_Z (in that order). Let vector u be (a,b,c)^T (i.e. the position vector in our new system), and let v be the position vector in our old system. With these definitions we have

M u + 2D_O = v

We explicitly know M, 2D_O and v (the position vector of A in the old system), and we want to work out u. So we re-arrange to get

u = M^-1 (v - 2D_O)

where M^-1 is the inverse of matrix M (it will always exist). See

https://www.mathsisfun.com/algebra/matr ... ugate.htmlfor a way to find the inverse of a matrix (or search online there are lots of examples).

Hope this helped,

R. Baber.