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.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Program to find line passing through 2 Points
- Program to check whether 4 points in a 3-D plane are Coplanar
- Program to find X, Y and Z intercepts of a plane
- Hammered distance between N points in a 2-D plane
- Number of triangles in a plane if no more than two points are collinear
- Program to find number of solutions in Quadratic Equation
- Number of ordered points pair satisfying line equation
- Program to determine the quadrant of the cartesian plane
- Program to determine the octant of the axial plane
- Equation of circle when three points on the circle are given
- Find mirror image of a point in 2-D plane
- Find the foot of perpendicular of a point in a 3 D plane
- Find foot of perpendicular from a point in 2 D plane to a Line
- Program to balance the given Chemical Equation
- Find the number of solutions to the given equation
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.