Ahhh, just checked the images you added.
So basically you want to project a 3D vector onto 2 other vectors (which are still 3D vectors, but they’re both on the same plane)
https://en.wikipedia.org/wiki/Dot_product
https://en.wikipedia.org/wiki/Scalar_resolute
If vector A is the vector to project, and vector B is the vector representing the X axis on your plane:
A dot B = ||A|| * ||B|| * cos(theta) , where theta is the angle between the two vectors
As shown here, you need ||A||*cos(theta)
So if you do:
(A dot B ) / ||B|| (note that if B is a unit vector, you don’t even need to divide here)
it gives you the length of A, in the direction of B.
Converting a vector V to a (X,Y) coordinate on your plane if X and Y are two unit vectors:
( (V dot X) ; (V dot Y) )
You might need to invert V, depending on what you want…
Test example with an orthogonal system: the plane’s normal is (0,0,1)
the plane’s X,Y axis vectors are (1,0,0) and (0,1,0)
The coordinate is (3,4,5)… the vector is either (3,4,5) or (-3,-4,-5), depending on which end you want the origin to be.
V dot X = (3,4,5) Dot (1,0,0) = 3
V dot Y = (3,4,5) Dot (0,1,0) = 4
(X,Y) = 3,4
Which, in this case, is just like just removing the z coordinate, so it seems to work.