I need to solve an equation of a line using three known coordinate pairs (x0, y0), (x1, y1), and (x2, y2).
The equation of the plane is, of course, ax + by + c = 0.
I'm writing a little piece of code to calculate the position of a point w.r.t a line as it changes, so I just want to reduce the math as much as possible for efficiency, which means pre-solving this in terms of the x and y coordinates.
I can derive the equations to solve for a, b and c by hand in advance and write the code that way, but it ends up an ugly mess of substitutions to do it.
Is there a more straightforward approach that, giving my coordinates, I can solve for the constants quickly, without having to rely on matrix math or pulling in a math library?