Equation of a line in two dimensional plane is ax + by + c = 0
How to find coefficients {a, b, c}?
We can find them by simplifying and modifying this:
after:
(x - x1)(y2 - y1) = (y - y1)(x2 - x1)
x(y2 - y1) - x1(y2 - y1) = y(x2 - x1) - y1(x2 - x1)
(y2 - y1) * x + (x1 - x2) * y + y1(x2 - x1) + x1(y2 - y1) = 0
a = y2 - y1
b = x1 - x2
c = - by1 - ax1
Also, we can find coefficients {a, b, c, d} of a line in 3D space. Like this: ax + by + cz + d = 0.
Like in 2D we use this formula
It is all...