I'm trying to figure out how to project a point onto a plane, I think my mistake is in the last step can anybody see where I'm wrong, I'm getting negative values but I'm expecting positive ones. The values are correct but negative.
Thanks
Madaxe
Project a Point(B) = 0 ; 0 ; 0 onto the plane as described
A plane passing through the point (A) = 1 ; 3 ; 2 and has normal vector (N) = 6 ; 7 ; 5, then the equation of the plane is;
[MATH] Point (A) = 1 \space; \space 3 \space ; \space 2 \\ \overrightarrow{N} = 6 \space ; \space 7 \space ; \space 5 \\ Plane \space Equation = 6(x−1 \normalsize)+7(y−3 \normalsize)+5(z−2 \normalsize)=0 \\ = 6x - 6 + 7y-21+5z-10 = 0 \\ = 6x + 7y + 5z -6 -21 -10 = 0 \\ = 6x + 7y + 5z -37 = 0 \\ [/MATH]
create an arbitrary point on the plane, to do this well use Point(B) 5 ; 5 ; Z
[MATH] Point (C) = 5 \space; \space 5 \space ; \space Z \\ Plane Equation = 6x + 7y + 5z - 37 = 0 \\ = ( 6 * 5 ) + ( 7 * 5 ) + ( 5 * Z ) - 37 = 0 \\ = 30 + 35 + 5Z - 37 = 0 \\ = 5Z = - 30 - 35 + 37 \\ = 5Z = -28 \\ = Z = -28/5\\ = Z = -5.6 [/MATH]
[MATH] \overrightarrow{BA} \\ = Ax - Bx ; Ay - By ; Az - Bz \\ = 0 - 5 ; 0 - 5 ; 0 - -5.6 \\ I = -5 ; J = -5 ; K = 5.6 [/MATH]
[MATH] \overrightarrow{BA} \cdotp \overrightarrow{N} \\ = (BA\tiny{X} \normalsize N\tiny{X} \normalsize)+(BA\tiny{Y} \normalsize N\tiny{Y} \normalsize)+(BA\tiny{Z} \normalsize N\tiny{Z} \normalsize)\\ = ( -5 * 6 ) + ( -5 * 7 ) + ( 5.6 * 5 ) \\ = 30 + 35 + -28 \\ = 37 [/MATH]
[MATH] Distance = 37 / ||{N}|| \\ = \sqrt{I^2 + J^2 + K^2} \\ = \sqrt{6^2 + 7^2 + 5^2} \\ = \sqrt{36 + 49 + 25} \\ = \sqrt{110} \\ ||{N}||= 10.488 \\ 37 / 10.488 = 3.5278 [/MATH]
[MATH] Point(PRJ.) = Point(A) - (Distance * \widehat{N}) \\ \widehat{N} = \overrightarrow{N} / ||{N}|| \\ ||{N}|| = \sqrt{I^2 + J^2 + K^2} \\ = \sqrt{6^2 + 7^2 + 5^2} \\ = \sqrt{36 + 49 + 25} \\ = \sqrt{110} \\ = 10.488 \\ \widehat{N} = \overrightarrow{N} / ||{N}|| \\ = (6/10.488) ; (7/10.488) ; (5/10.488)\\ = 0.572 ; 0.667 ; 0.476 \\ Point(PRJ.) X = 0 - (3.5278 * 0.572) = -2.018\\ Point(PRJ.) Y = 0 - (3.5278 * 0.667) = -2.355\\ Point(PRJ.) Z = 0 - (3.5278 * 0.476) = -1.682\\ [/MATH]
Thanks
Madaxe
Project a Point(B) = 0 ; 0 ; 0 onto the plane as described
A plane passing through the point (A) = 1 ; 3 ; 2 and has normal vector (N) = 6 ; 7 ; 5, then the equation of the plane is;
[MATH] Point (A) = 1 \space; \space 3 \space ; \space 2 \\ \overrightarrow{N} = 6 \space ; \space 7 \space ; \space 5 \\ Plane \space Equation = 6(x−1 \normalsize)+7(y−3 \normalsize)+5(z−2 \normalsize)=0 \\ = 6x - 6 + 7y-21+5z-10 = 0 \\ = 6x + 7y + 5z -6 -21 -10 = 0 \\ = 6x + 7y + 5z -37 = 0 \\ [/MATH]
create an arbitrary point on the plane, to do this well use Point(B) 5 ; 5 ; Z
[MATH] Point (C) = 5 \space; \space 5 \space ; \space Z \\ Plane Equation = 6x + 7y + 5z - 37 = 0 \\ = ( 6 * 5 ) + ( 7 * 5 ) + ( 5 * Z ) - 37 = 0 \\ = 30 + 35 + 5Z - 37 = 0 \\ = 5Z = - 30 - 35 + 37 \\ = 5Z = -28 \\ = Z = -28/5\\ = Z = -5.6 [/MATH]
[MATH] \overrightarrow{BA} \\ = Ax - Bx ; Ay - By ; Az - Bz \\ = 0 - 5 ; 0 - 5 ; 0 - -5.6 \\ I = -5 ; J = -5 ; K = 5.6 [/MATH]
[MATH] \overrightarrow{BA} \cdotp \overrightarrow{N} \\ = (BA\tiny{X} \normalsize N\tiny{X} \normalsize)+(BA\tiny{Y} \normalsize N\tiny{Y} \normalsize)+(BA\tiny{Z} \normalsize N\tiny{Z} \normalsize)\\ = ( -5 * 6 ) + ( -5 * 7 ) + ( 5.6 * 5 ) \\ = 30 + 35 + -28 \\ = 37 [/MATH]
[MATH] Distance = 37 / ||{N}|| \\ = \sqrt{I^2 + J^2 + K^2} \\ = \sqrt{6^2 + 7^2 + 5^2} \\ = \sqrt{36 + 49 + 25} \\ = \sqrt{110} \\ ||{N}||= 10.488 \\ 37 / 10.488 = 3.5278 [/MATH]
[MATH] Point(PRJ.) = Point(A) - (Distance * \widehat{N}) \\ \widehat{N} = \overrightarrow{N} / ||{N}|| \\ ||{N}|| = \sqrt{I^2 + J^2 + K^2} \\ = \sqrt{6^2 + 7^2 + 5^2} \\ = \sqrt{36 + 49 + 25} \\ = \sqrt{110} \\ = 10.488 \\ \widehat{N} = \overrightarrow{N} / ||{N}|| \\ = (6/10.488) ; (7/10.488) ; (5/10.488)\\ = 0.572 ; 0.667 ; 0.476 \\ Point(PRJ.) X = 0 - (3.5278 * 0.572) = -2.018\\ Point(PRJ.) Y = 0 - (3.5278 * 0.667) = -2.355\\ Point(PRJ.) Z = 0 - (3.5278 * 0.476) = -1.682\\ [/MATH]