The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Project points using null()
Replies: 10   Last Post: Aug 25, 2015 5:17 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 4
Registered: 6/30/12
Re: Project points using null()
Posted: Jun 30, 2012 6:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Given a plane defined in constants XCoeff, YCoeff, CCoeff (see
z = XCoeff * x + YCoeff * y + CCoeff
how would you calculate Q and N for your method?

I tried
Q = [1, 1, (XCoeff+YCoeff+CCoeff)];
N = [XCoeff, YCoeff, -1];

and while the projected points do all lie on the plane they are not orthogonally projected onto the plane?

Best wishes


> Let P be the m x 3 array of the 3D points to be projected, let Q be the 1 x 3 vector of the given point on the plane, let N be the 1 x 3 vector of the normal direction to the plane, and let P0 be the m x 3 array of points orthogonally projected from P onto the plane. Then do this:
> N = N/norm(N); % <-- do this if N is not normalized
> N2 = N.'*N;
> P0 = P*(eye(3)-N2)+repmat(Q*N2,m,1);
> (You can also do that last line using bsxfun.)
> This can be derived from the single-point vector equation
> p0 = p - dot(p-q),n)*n
> where p is a vector to a point to be projected, q is a vector to the point on the plane, n is the unit normal vector to the plane, and p0 is the orthogonal projection of p onto the plane.
> Roger Stafford

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.