Clear Filters
Clear Filters

find the way to transfer 2D projection back to 3D

11 views (last 30 days)
I have a 3D line and I want to
1) project the 3D line to 2D space
2) perform analysis
3)transfer back to 3D
however I could not find the appropriate way in 3rd step.
for example, I have a line
A= [0.001 0.0001 -0.0004;0.002 0.0001 -0.0004];
I would like to project to X-Y plane based on normal vector
to transfer the 3D line to 2D, I use command:
however when I want to transfer it back, I use command:
C =
0.0010 0.0001 0
0.0020 0.0001 0
where C is different from A.
maybe the approach I'm using is not correct, my question is, is there any other better way, to make sure the transform from 3D and 2D is correct and robust?

Accepted Answer

John D'Errico
John D'Errico on 1 Apr 2024
Edited: John D'Errico on 1 Apr 2024
The projection you used into the nullspace was correct, AND robust. However the inverse operation is less easy to perform. You need to understand what you are doing, what these operations do.
Start with the "line". In fact, this is not a line, but two points in a 3-d space, which connected, imply a line of infinite extent.
A= [0.001 0.0001 -0.0004;0.002 0.0001 -0.0004];
You want to project that line into a plane defined by the normal vector, here
N = [0 0 1];
In this case of course, the implied projection plane is just the (x,y) plane. So the projection is simple enough. You are correct that null(N) will perform the projection.
ans =
0 -1
1 0
0 0
Ahat = A*null(N)
ans =
0.0001 -0.001
0.0001 -0.002
The result is a pair of points as rows of Ahat. This now lives in a 2-d projection plane. Note that the projection is not unique. It was arbitrarily chosen by null, which effectively mapped the triad (x,y,z) into the pair (y,-x). Effectively, that projection throws away all information about z, just tossing all that information into the proverbial bit bucket of mathematics.
Having done so, what happens when you want to do the reverse operation? What did I just tell you? YOU THREW IT ALL AWAY! That is to say, any information about z no longer exists in youe data!
The reverse operation, thus
ans =
0.001 0.0001 0
0.002 0.0001 0
restores x and y, but all information about z no longer exists! YOU THREW IT AWAY! GONE. Bit bucket limbo. Nada remains about z.
Effectively what that operation does is to view the projection plane as now a plane in 3-dimensions. But it is still just that 2-d plane.
What goes into the bit bucket of mathematics stays in the bit bucket. You cannot recover 3-dimensional information content from 2-dimensional data. All you can do is return the 2-d data into a 2-dimensional subspace of that 3-d domain.
Hmm. Let me say this another way. I'll take a picture of you with my trusty Polaroid camera. In effect, I have reduced the all of the information content in that original 3-d domain into a single 2-d projection of that scene. But having done so, now you want to recover the entire 3-d domain from simply that picture of it, knowing only the view point where you stood while taking the picture. While a picture paints a thousand words, it ain't enough.
  1 Comment
Yu Li
Yu Li on 1 Apr 2024
Hi John:
I totally agree with you, yes the 3D information was throw away during the operation, so the technical approach I used here (null(N) and null(N)') is not good. thank you very much for your detail explannation.
seems like "makehgtform" function may provide me the approach, I will try it.

Sign in to comment.

More Answers (0)


Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!