Hi, I am having signing issues in finding the equation of a plane. Typically i will check my
work http://www.ambrsoft.com/TrigoCalc/Plan3D/Plane3D_.htm and other sites and confirm my results which are usually right leading me to beleive i have solved it until I hit a data point that proves me otherwise. I think it may be something simple, going on with my D constant.
code to calculate, but can do longhand also:
glm::vec3 PQv(Qx1-Px1,Qy1-Py1,Qz1-Pz1);
glm::vec3 PRv(Rx1-Px1,Ry1-Py1, Rz1-Pz1);
glm::vec3 res = cross(PQv, PRv);
print_vector(PQv, "PQv ");
print_vector(PRv, "PRv ");
print_vector(res,"PQv x PRv result (dot cross product) Vn: ");
std::cout<<std::endl;
float A = res[0], B = res[1], C = res[2];
float D = 0;
std::cout<<A<<"x"<<B<<"y"<<C<<"z - D = 0"<<std::endl;
std::cout<<"multiply all terms by -1:"<<std::endl;
A = A *(-1);
B = B *(-1);
C = C *(-1);
//find d sub point P(x,y,z)
//flip D sign (pending)
std::cout<<"equation of plane is:"<<std::endl;
D = (A*Px1)+(B*Py1)+(C*Pz1);
D = D * -1; //as per above
std::cout<<A<<"x"<<B<<"y"<<C<<"z"<<D<<" = 0"<<std::endl;
I had no way to sign D until time of use.
The data set below I get different signs on the
http://www.ambrsoft.com/TrigoCalc/Plan3D/Plane3D_.htm site versus my own.
The data set:
pt. x (2,1,3)
pt. y (1,3,2)
pt. z (-1,2,4)
-3x-4y-5z + 25 = 0
versus
3x + 4y + 5z -25 = 0
I got the workup here, including the instruction to multiply the terms by -1:
Find the equation of a plane that passes through the points (1,0, 2), (-3, 5, 0) and (6, - 4, 2).
we choose the point (1, 0, 2) as the origin of the axes and will solve by vector method.
There are two vectors extending from the origin to the other two points:
The cross product of this two vectors gives the general direction of the perpendicular vector to the plane, this is also the direction coefficients of the plane.
hereTherefore the plane equation is: 8x + 10y + 9z + D = 0 (after multiplying all terms by -1)
Now D should be found, the origin point fulfills the plane equation so: 8*1 + 10*0 + 9*2 + D = 0
And the plane equation is: 8x + 10y + 9z − 26 = 0
work http://www.ambrsoft.com/TrigoCalc/Plan3D/Plane3D_.htm and other sites and confirm my results which are usually right leading me to beleive i have solved it until I hit a data point that proves me otherwise. I think it may be something simple, going on with my D constant.
code to calculate, but can do longhand also:
glm::vec3 PQv(Qx1-Px1,Qy1-Py1,Qz1-Pz1);
glm::vec3 PRv(Rx1-Px1,Ry1-Py1, Rz1-Pz1);
glm::vec3 res = cross(PQv, PRv);
print_vector(PQv, "PQv ");
print_vector(PRv, "PRv ");
print_vector(res,"PQv x PRv result (dot cross product) Vn: ");
std::cout<<std::endl;
float A = res[0], B = res[1], C = res[2];
float D = 0;
std::cout<<A<<"x"<<B<<"y"<<C<<"z - D = 0"<<std::endl;
std::cout<<"multiply all terms by -1:"<<std::endl;
A = A *(-1);
B = B *(-1);
C = C *(-1);
//find d sub point P(x,y,z)
//flip D sign (pending)
std::cout<<"equation of plane is:"<<std::endl;
D = (A*Px1)+(B*Py1)+(C*Pz1);
D = D * -1; //as per above
std::cout<<A<<"x"<<B<<"y"<<C<<"z"<<D<<" = 0"<<std::endl;
I had no way to sign D until time of use.
The data set below I get different signs on the
http://www.ambrsoft.com/TrigoCalc/Plan3D/Plane3D_.htm site versus my own.
The data set:
pt. x (2,1,3)
pt. y (1,3,2)
pt. z (-1,2,4)
-3x-4y-5z + 25 = 0
versus
3x + 4y + 5z -25 = 0
I got the workup here, including the instruction to multiply the terms by -1:
Find the equation of a plane that passes through the points (1,0, 2), (-3, 5, 0) and (6, - 4, 2).
we choose the point (1, 0, 2) as the origin of the axes and will solve by vector method.
There are two vectors extending from the origin to the other two points:
V1 = (-3 - 1)i + (5 - 0)j + (0 - 2)k = -4i +5j -2k |
V2 = (6 - 1)i + (-4 - 0)j + (2 - 2)k = 5i - 4j |

Now D should be found, the origin point fulfills the plane equation so: 8*1 + 10*0 + 9*2 + D = 0
And the plane equation is: 8x + 10y + 9z − 26 = 0
Last edited: