1.
Let the line be defined by the equation , and the quadratic, by the equation
. We want the point
that satisfies both equations, so we have,
This tells us that,
Grouping like terms and moving everything to the right side of the equation, we get,
Now let ,
, and
. Then we have,
We can solve this by applying the quadratic formula. We get the following two solutions:
Solution #1:
Solution #2:
If the solutions are imaginary (i.e. you end up with a square root of a negative number), then the line does not intersect the quadratic. Otherwise, the solutions are given by the above equations and the corresponding 's can be found by substituting the
's into either the equation for the line (which is easiest) or the equation for the quadratic (which will give the same answer, but is computationally a bit more demanding).
2.
Let the line be defined by the following three equations:
Let the plane be defined by the following equation:
Let the intersection point be designated by . Then we have the following equations:
Substituting the top three equations into the bottom equation, we get the following equation in t:
Grouping like terms, and moving everything over to the right side of the equation, we get the following:
Solving for t, we get the following solution:
If the denominator evaluates to zero, the line does not intersect the plane.
3.
Represent the body as a series of spheres, and then check for intersections between a 3D line (representing the line-of-fire) and the spheres.
4.
The line originates at the location of the camera, and passes through the point
, so we can represent the line parametrically as follows:
5.
Points above the line will have a greater y value, so for these points,
. Points below the line are described by the inequality
.
6.
Pick a point known to be inside the polygon. For each edge (represented as a line), check the inside point to see if it falls above or below the edge. If the test point satisfies the same inequalities as the inside point, then the test point is inside the polygon, otherwise, it lies outside the polygon.
This only works for convex polygons.
7.
The near and far planes are defined by (the distance from the viewer to the computer screen), and
(some upper limit on the depth of view), respectively.
The derivation of the equation for the top plane is graphically illustrated below.
The bottom plane, then, is , and by symmetry, the right and left planes are
, and
, respectively.
8.
From the left or right side, the top, bottom, near, and far view planes look like lines. Similarly, from the top or bottom, the right, left, near, and far view planes look like lines. These lines can be used to form a total of four quadrilaterals (4-sided polygons). The right and left quadrilaterals, along with the test point, can be projected onto the plane, and the top and bottom quadrilaterals, as well as the test point, can be projected onto the
plane. If the projected test points falls within the boundaries of the projected quadrilaterals, and the test point falls within the
and
view planes, the point is visible. Otherwise it is not.