Content deleted Content added
Undid revision 718388679 by 117.55.247.118 (talk) |
No edit summary |
||
Line 1:
In [[computer graphics]], the '''
Consider first the usual parametric form of a straight line:
:<math>x = x_0 + u (x_1 - x_0) = x_0 +
:<math>y = y_0 + u (y_1 - y_0) = y_0 +
A point is in the clip window, if
:<math>x_{\text{min}} \le x_0 +
and
:<math>y_{\text{min}} \le y_0 +
which can be expressed as the 4 inequalities
:<math>
where
Line 25:
# When <math>p_k < 0</math> the line proceeds outside to inside the clip window and when <math>p_k > 0</math>, the line proceeds inside to outside.
# For nonzero <math>p_k</math>, <math>u = \frac{q_k}{p_k}</math> gives the intersection point.
# For each line, calculate <math>u_1</math> and <math>u_2</math>. For <math>u_1</math>, look at boundaries for which <math>p_k < 0</math> (i.e. outside to inside). Take <math>u_1</math> to be the largest among <math>\left\{ 0,\frac{q_k}{p_k} \right\}</math>. For <math>
==See also==
Algorithms used for the same purpose:
|