given two points
we will be defining the line in terms of two slopes, delt(y) / delta(x) and delta(z) / delta(x)
if delta(x) = 0 these slopes cannot be defined
if delta(y) also = 0 we will call this case 0 and we call the line vertical, or "v"
if delta(y) does not = 0 we call this case 1 and
the line is defined by its x value and
the slope delta(z) / delta(y)
but if delta(y) = 0 that slope cannot be defined
we call this line "horizontal" or "h"
it is defined by its x value and its y value.
if delta(x) = 0 and delta(y) does not = 0
we call this line "parallel" or "p"
it is defined by its x value, its y = 0 intercept which we call bz
and its delta(z) / delta(y) slope, which we call mzy
if delta(x) does not = 0
we call the line "normal"
it is defined by two equation:
y = myx*x + b.y
z = myz*x + b.z
three cases:
vertical
parallel
normal
p1 and p2 are defined
p1.x and p1.y are defined
p1.x and p2.y are defined
l.p1 = p1
l.p2 = p2
function definetheline(l) {
l.deltax = l.p1.x - l.p2.x
l.deltay = l.p1.y - l.p2.y
l.deltaz = l.p1.z - l.p2.z
if (l.deltax = 0 && l.deltay = 0) {
return defineavline(l)}
else if (l.deltax = 0 && l.deltay != 0) {
return defineapline(l)}
else {return defineannline(l)}}