Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Project points to subspace


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Doublefris   Members   -  Reputation: 316

Like
0Likes
Like

Posted 15 January 2014 - 09:28 AM

Let's say I have some coplanar points in R^3. I want to describe these points by coordinates on the plane they share, in R^2. This way I can do some tests faster. How should I do this? 



Sponsor:

#2 jjd   Crossbones+   -  Reputation: 2116

Like
4Likes
Like

Posted 15 January 2014 - 09:53 AM

Let's say I have some coplanar points in R^3. I want to describe these points by coordinates on the plane they share, in R^2. This way I can do some tests faster. How should I do this? 

 

Take any 3 distinct points A, B, and C. Take the cross product of (B - A) and (C - A) to get the normal, N, of the plane. Let (B - A) be one of your axes (normalize it). Take the cross product of N and (B - A) to get another orthogonal vector in the plane as the other axes (normalize it). Then project your points (relative to A) in your new axes.

 

-Josh


Edited by jjd, 15 January 2014 - 09:59 AM.

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet


#3 Doublefris   Members   -  Reputation: 316

Like
0Likes
Like

Posted 15 January 2014 - 10:30 AM

Thanks! Am I right when I think that the final projection could be a matrix multiplication by the 2x3 vectors we obtained? 



#4 jjd   Crossbones+   -  Reputation: 2116

Like
1Likes
Like

Posted 15 January 2014 - 10:33 AM

Thanks! Am I right when I think that the final projection could be a matrix multiplication by the 2x3 vectors we obtained? 

 

Yes, once you have subtracted A from all of the points.

 

-Josh


--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet


#5 Álvaro   Crossbones+   -  Reputation: 13649

Like
2Likes
Like

Posted 15 January 2014 - 10:36 AM

If you have an orthonormal basis of your subspace, you can find the coefficients of the projection by simply computing the inner product of the vector to be projected and the basis vectors. So yes, the computation boils down to a matrix multiplication that turns three numbers into two.

 

In order to get an orthonormal basis for the sub-space, you can use the Gram-Schmidt process.

 

[EDIT: I am not saying anything new, just rephrasing what others have said, in the hopes that my description might be easier to understand to some.]


Edited by Álvaro, 15 January 2014 - 10:38 AM.


#6 Doublefris   Members   -  Reputation: 316

Like
0Likes
Like

Posted 06 February 2014 - 04:50 PM

I'm wondering if there's a way to avoid having to subtract the subspace's origin before doing projection, by encoding the origin in the matrix. Is it possible using homogenous coordinates?



#7 Álvaro   Crossbones+   -  Reputation: 13649

Like
0Likes
Like

Posted 06 February 2014 - 04:54 PM

I'm wondering if there's a way to avoid having to subtract the subspace's origin before doing projection, by encoding the origin in the matrix. Is it possible using homogenous coordinates?

 

Yes, you can encode a translation into the matrix by adding a row and a column and by appending a "1" to the coordinates of the point. This is related to homogeneous coordinates, but I am not going to try to describe the details here.



#8 Doublefris   Members   -  Reputation: 316

Like
0Likes
Like

Posted 06 February 2014 - 04:58 PM

I haven't tried but wouldn't I have to subtract the origin BEFORE doing the projection? or does the order not matter?



#9 Álvaro   Crossbones+   -  Reputation: 13649

Like
0Likes
Like

Posted 06 February 2014 - 05:46 PM

You can either subtract the origin of the subspace before the projection or subtract the projection of the origin of the subspace after the projection.

Projection(P - O) = Projection(P) - Projection(O) (because the projection is linear)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS