Docsity

Solving Vector Equations and Convex Polygon Detection - Prof. Benjamin B. Bederson, Assignments of Computer Graphics

Toggle sidebar
bg1
CMSC427/828E Spring 2000
Homework # 4
March 8, 2000
1. First state the equations of
Q
1
,
Q
2
and
R
:
Q
1
=
P
1
+
t
(
P
2
,
P
1
) (1)
Q
2
=
P
2
+
t
(
P
3
,
P
2
) (2)
R
=
Q
1
+
t
(
Q
2
,
Q
1
) (3)
Now, substitute
Q
1
,
Q
2
in equation 3 by equations 1 and 2
R
=
P
1
+
t
(
P
2
,
P
1
)+
t
(
P
2
+
t
(
P
3
,
P
2
)
,
P
1
,
t
(
P
2
,
P
1
))
=
P
1
+
t
(
P
2
,
P
1
)+
t
(
P
2
,
P
1
)+
t
2
(
P
3
,
P
2
,
P
2
+
P
1
)
=
P
1
+2
t
(
P
2
,
P
1
)+
t
2
(
P
3
,
2
P
2
+
P
1
) (4)
The outline of R is a parabola as in g 1.
2. In this question, wewant map the point(
x; y
)to(
x
S
;y
S
) as in gure 2:
Looking on the x-axis, we will notice that
c
d
=
a
b
, and thus :
(
x
S
,
u
min
)
(
u
max
,
u
min
)
=
(
x
,
x
min
)
(
x
max
,
x
min
)
(5)
multiply by(
u
max
,
u
min
), and getting
u
m
in
to the right hand side results in :
x
S
=
u
min
+
(
u
max
,
u
min
)
(
x
max
,
x
min
)
(
x
,
x
min
) (6)
and similarly,we can derive
y
S
,as:
y
S
=
v
min
+
(
v
max
,
v
min
)
(
y
max
,
y
min
)
(
y
,
y
min
) (7)
1
pf3

Partial preview of the text

Download Solving Vector Equations and Convex Polygon Detection - Prof. Benjamin B. Bederson and more Assignments Computer Graphics in PDF only on Docsity!

CMSC427/828E Spring 2000

Homework # 4

March 8, 2000

  1. First state the equations of Q 1 , Q 2 and R :

Q 1 = P 1 + t(P 2 P 1 ) (1) Q 2 = P 2 + t(P 3 P 2 ) (2) R = Q 1 + t(Q 2 Q 1 ) (3)

Now, substitute Q 1 , Q 2 in equation 3 by equations 1 and 2

R = P 1 + t(P 2 P 1 ) + t(P 2 + t(P 3 P 2 ) P 1 t(P 2 P 1 )) = P 1 + t(P 2 P 1 ) + t(P 2 P 1 ) + t^2 (P 3 P 2 P 2 + P 1 ) = P 1 + 2 t(P 2 P 1 ) + t^2 (P 3 2 P 2 + P 1 ) (4)

The outline of R is a parab ola as in g 1.

  1. In this question, we want map the p oint (x; y ) to (xS ; yS ) as in gure 2:

Lo oking on the x-axis, we will notice that cd = ab , and thus :

(xS umin ) (umax umin )

(x xmin ) (xmax xmin )

multiply by (umax umin ), and getting um in to the right hand side results in :

xS = umin +

(umax umin ) (xmax xmin )

(x xmin ) (6)

and similarly, we can derive yS , as :

yS = vmin +

(vmax vmin ) (ymax ymin )

(y ymin ) (7)

P

P (^) P

Q (^) Q

R

1

2

(^12)

3 Figure 1: Outline for solution

(x,y)

a

b

Source Rectangle

c

d

(x ,y ) S S

Destination Rectangle

Figure 2: Mapping question