given a point F (F.x, F.y, F.z) and another point, P (P.x, P.y, P.z), define the line FP.
the line might be parallel to the xz coordinate plane
this would mean there would be no change in y given any change in x or z
maybe to put this another way
if F.x = P.x the line is perpendicular to the x axis
its formula reads in part x = n.x = F.x = P.x
also
if F.z = P.z the line is perpendicular to the z axis
z = n.z = F.z = P.z
if F.x = P.x and F.z = P.z
the formula for the line is x = F.x, z = F.z for any value of y
now normally we are going to want to provide a value for x
and derive y and z from the line's formula
if F.x = P.x we need to take another approach
if F.x != P.x we can proceed this way
if F.x != P.x the next question might be
does F.z = P.z?
but, we may not need to ask
the relationship between z and x is z = m.zx*x + b.z
m.zx = (F.z - P.z) / (F.x - P.x)
in the case of our line F.x != P.x and F.z = P.z
m.zx = 0 / (F.x - P.x) = 0 thus z = b.z for any value of x
given the points F (F.x, F.y, F.z) and P (P.x, P.y, P.z), define a formula for FP
if F.x = Z.x define a formula
if F.x != Z.x define a formula
the first case could be called the undefined Z case
and it would result in an undefined Z type forumula
the first case could be called the defined Z case
and it would result in a defined Z type formula
deriving the undefined Z type formula
we are now looking for a value for y given a value for z
this could be an undefined Z undefined Y type line
if F.x = Z.x the line is an undefined Z type
and then if F.z = Y.z the line is an undefined Y type
and its formula is x = n.x, z = n.z
the line types:
defined Z: defined Y, undefined Y
undefined Z: defined Y, undefined Y
this is possibly complete
given two points, F and P, defining a line L
and three points, A, B, and C, defining a plane O
find the intersection I (a point) of L and O, if it exists
returns I.x, I.y, I.z, and yes/no
we now need to derive a formula for the plane
we can begin by sorting planes into two types
xz intersecting and non xz intersecting
the formula for a non xz intersecting plane is y = n.y
how we can tell whether a plane is xz intersecting or not:
if A.y = B.y = C.y the plane is non intersecting
in the case of the xz intersecting plane
the intersection of the plane and the xz axial plane
is a line on the xz axial plane
which can be defined using two points on the xz axial plane
the three points that define the plane define three lines
AB, BC, and CA
first we will test AB
we are testing to find a first point of intersection
var firstpoi = "undefined"
var secondpoi = "undefined"
var linetotest = 1
while (firstpoi === "undefined") {
test(getline(linetotest),firstpoi)
linetotest = linetotest + 1}
while (secondpoi === "undefined") {
test(getline(linetotest),secondpoi)
linetotest = linetotest + 1}
the three types of planes are
undefined x undefined z, defined x undefined z, and defined x defined z
i overlooked something
a plane can be of undefined x undefined z type
but on the xz axial plane, so it intersects the xz plane
and all lines on it intersect the xz plane
but, if the plane is undefined x undefined z (A.y = B.y = C.y)
we don't need to test the lines for intersection anyway
and again!
it is possible that one of the three lines defining a plane (as described)
will be parallel to the xz plane
while the other two intersect the xz plane at the same point
so that the three lines will not define two points on the xz plane
and thus will not define the line of intersection of the plane and the xz plane
now, if the plane does intersect the xz plane (to form a line)
which we would know because it is not undefined x undefined z
it is possible that all three lines AB, BC, and CA do intersect the plane
or it is possible that one of them does not
so we could test AB and find that it does intersect the xz axial plane
we would then have a point md1 (md1.x, md1,y)
the intersection of AB and the xy axial plane
now we can test a line through C parallel to AB
which will give us another point, md2 (md2.x, md2.z)
let's give the xz axial plane the name B (for base)
recalling that our test plane, or object, is named O
if we find that AB does not intersect B
then we know that BC does intersect B
(because BC is not parallel to AB and O does intersect B)
now md1 is the intersection of BC and B
and md2 is the intersection of
a line parallel to BC through A
and B
let's also define a normal plane
as a plane which does intersect B to form a line with a defined slope m.zx
its formula will be z = m.zx*x + b and y = m.yz*z ... maybe
let's also define a normal line
it is not parallel to B
it has a defined xy slope
its formula will be z = m.zx*x + b.z and y = m.yz*z + b.y