Page 90 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 90
Lab on Computer Graphics
Notes DD ← –2*cos (φ2R)*(cos (φ 2 R)*H2_TR + sin (φ 2 R)*K2_TR)/A 22
2*sin (φ 2 R)*(sin (φ 2 R)*H 2 _TR – cos (φ 2 R)*K 2 _TR)/B2216
EE ← –2*sin (φ 2 R)* (cos (φ 2 R)*H 2 _TR + sin (φ 2 R)*K 2 _TR)/A 22 + 2*cos (φ 2 R)* (sin
(φ 2 R)*H 2 _TR – cos (φ 2 R)*K 2 _TR)/B2217
FF ← (–cos (φ 2 R)*H2_TR – sin (φ 2 R)*K 2 _TR)2/A 22 + (sin (φ 2 R)*H 2 _TR – cos
(φ 2 R)*K 2 _TR)2/B 22 – 1
cy[4] ← A 14 *AA 2 + B 12 *(A 12 *(BB 2 – 2*AA*CC)+ B 12 *CC 2 )
cy[3] ← 2*B 1 *(B 12 *CC*EE + A 12 *(BB*DD – AA*EE))
cy[2] ← A 12 *((B 12 *(2*AA*CC – BB 2 ) + DD 2 – 2*AA*FF)–2*A 12 *AA 2 + B 12 *(2*CC*FF
+ EE2)
cy[1] ← 2*B 1 *(A 12 *(AA*EE – BB*DD) + EE*FF)
cy[0] ← (A 1 *(A 1 *AA – DD) + FF)*(A 1 *(A 1 *AA + DD) + FF)
py[0] ← 1
do if (|cy[4]| > 0)
then for i ← 0 to 3 by 1
py[4–i] ← cy[i]/cy[4]
r[][] ← BIQUADROOTS (py[])
nroots ← 4
else if (|cy[3]| > 0)
then for i ← 0 to 2 by 1
py[3–i] ← cy[i]/cy[3]
r[][] ← CUBICROOTS (py[])
nroots ← 3
else if (|cy[2]| > 0)
then for i ← 0 to 1 by 1
py[2–i] ← cy[i]/cy[2]
r[][] ← QUADROOTS (py[])
nroots ← 2
else if (|cy[1]| > 0)
then r[1][1] ← (–cy[0]/cy[1])
r[2][1] ← 0
nroots ← 1
else
nroots ← 0
nychk ← 0
for i ← 1 to nroots by 1
84 LOVELY PROFESSIONAL UNIVERSITY