Search code examples
geometryplane

Describe a plane with z = ax + by + c


I have three points in 3-D space. I want to describe the plane defined by these three points with the equation z = ax + by + c. How can I find the values of a, b, and c which do so?

Said another way: I have a plane described by the equation z = ax + by + c. I have two points which I want to remain in the plane, and a third point which does not yet lie in the plane. I want to rotate the plane about the axis described by the first two points, so that the third point is now in the plane, and then find the a, b, and c which describe this new plane using the same formula. I've looked up how to rotate a point in the plane about the axis (and how to find the correct angle of rotation given the new point I want the plane to pass through), but I'm not sure how to work back to ax + by + c from there.

Said yet another way (this is the most convenient way for me to think about it): I have a function f(x,y) = ax + by + c, and I want to change the value of f(x1,y1) by a certain amount without changing f(x2,y2) or f(x3,y3).


Solution

  • Substitute coordinates of points (xi,yi,zi) to plane equations, and solve this system of linear equations for unknown a,b,c. Cramer's rule is suitable for three-unknowns system. If you have some math library with ready-to-use Gauss elimination, LU method or another solving methods, you can use them.

    a*x1 + b*y1 + c = z1
    a*x2 + b*y2 + c = z2
    a*x3 + b*y3 + c = z3