Given three points (x1, y1, z1), (x2, y2, z2), (x3, y3, z3). The task is to find the equation of the plane passing through these 3 points.
Input: x1 = -1 y1 = w z1 = 1
x2 = 0 y2 = -3 z2 = 2
x3 = 1 y3 = 1 z3 = -4
Output: equation of plane is 26 x + 7 y + 9 z + 3 = 0.
Input: x1 = 2, y1 = 1, z1 = -1, 1
x2 = 0, y2 = -2, z2 = 0
x3 = 1, y3 = -1, z3 = 2
Output: equation of plane is -7 x + 5 y + 1 z + 10 = 0.
Approach: Let P, Q and R be the three points with coordinates (x1, y1, z1), (x2, y2, z2), (x3, y3, z3) respectively. Then the equation of plane is a * (x – x0) + b * (y – y0) + c * (z – z0) = 0, where a, b, c are direction ratios of normal to the plane and (x0, y0, z0) are co-ordinates of any point(i.e P, Q, or R) passing through the plane. For finding direction ratios of normal to the plane, take any two vectors in plane, let it be vector PQ, vector PR.
=> Vector PQ = (x2 - x1, y2 - y1, z2 - z1) = (a1, b1, c1). => Vector PR = (x3 - x1, y3 - y1, z3 - z1) = (a2, b2, c2).
Normal vector to this plane will be vector PQ x vector PR.
=> PQ X PR = (b1 * c2 - b2 * c1) i + (a2 * c1 - a1 * c2) j + (a1 * b2 - b1 *a2) k = ai + bj + ck.
Direction ratios of normal vector will be a, b, c. Taking any one point from P, Q, or R, let its co-ordinate be (x0, y0, z0). Then the equation of plane passing through a point(x0, y0, z0) and having direction ratios a, b, c will be
=> a * (x - x0) + b * (y - y0) + c * (z - z0) = 0. => a * x - a * x0 + b * y - b * y0 + c * z - c * z0 = 0. => a * x + b * y + c * z + (- a * x0 - b * y0 - c * z0) = 0.
Below is the implementation of the above approach:
equation of plane is 26 x + 7 y + 9 z + 3 = 0.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the equation of plane which passes through two points and parallel to a given axis
- Program to find line passing through 2 Points
- Minimum points to be selected such that removal of line segments passing through them empties given array
- Program to check whether 4 points in a 3-D plane are Coplanar
- Maximum distinct lines passing through a single point
- Mirror of a point through a 3 D plane
- Maximum distance between two points in coordinate plane using Rotating Caliper's Method
- Number of triangles in a plane if no more than two points are collinear
- Hammered distance between N points in a 2-D plane
- Number of ordered points pair satisfying line equation
- Equation of circle when three points on the circle are given
- Find the point on X-axis from given N points having least Sum of Distances from all other points
- Program to find X, Y and Z intercepts of a plane
- Number of Integral Points between Two Points
- Count of obtuse angles in a circle with 'k' equidistant points between 2 given points
- Minimum number of points to be removed to get remaining points on one side of axis
- Ways to choose three points with distance between the most distant points <= L
- Program to determine the quadrant of the cartesian plane
- Program to determine the octant of the axial plane
- Find mirror image of a point in 2-D plane
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.