Thursday, August 11, 2016

baseline

Having determined the locations of two points which define the intersection (a line) of a defined plane and the x - y axial plane, our next objective is to write an equation for that line.

First we must test for line type. One type will give the equation x = n, another y = mx + b. If our two points are (x1, y1) and (x2, y2) and x1 = x2, the line is of the first type, and its formula is x = x1. If x1 != x2 the line is of the second type.

In order to write an equation of the second type we must calculate m and b:

m = (y1 - y2) / (x1 - x2)

Since b is defined as the value of y where x = 0 ... but, no, that won't work.

m = (b - y2) / (0 - x2)
m * -x2 = b - y2
b = (m * -x2) - y2

We now have all the information required to calculate z for any combination of x and y where (x, y, z) is a point on the plane P.