Moving lines

advertisement
1
Introduction, motivation and
definitions
Pencils of lines
Moving lines
Curve implicitization with two moving lines
2
Implicitization
For any 2-D parametric curve
𝑥 𝑡 =
𝑎 𝑡
,
𝑑(𝑡)
𝑦 𝑡 =
𝑏 𝑡
𝑑 𝑡
(𝑎,𝑏,𝑑 are polynomials), there exists an implicit equation
𝑓 𝑥, 𝑦 = 0, s.t 𝑓 is also a polynomial, which defines exactly
the same curve.
Example: a circle can be defined by the parametric equation 𝑥
1−𝑡 2
,
1+𝑡 2
=
= 0.
𝑦=
2𝑡
,
1+𝑡 2
or by the implicit equation 𝑥 2 + 𝑦 2 − 1
The process of finding the implicit equation given the
parametric equations is known as implicitization.
3
Implicitization- why ?
Implicitization of 2-D curves leads to many practical
algorithms.
For example, a very fast algorithm for computing the
intersection of 2-D curves of low degree is based on
implicitization.
Implicitization reduces the problem of curve intersection to
one of finding the roots of a single polynomial.
4
The standard method
The standard method for implicitizing a 2-D
curve is to use Bezout’s resultant.
For a degree 𝑛 rational curve, Bezout’s resultant
is the determinant of an 𝑛 × 𝑛 matrix whose
elements are linear in 𝑥, 𝑦.
5
Contributions
It is a classical result that two corresponding pencils of
lines intersect in a conic section.
This paper presents an extension to this idea to higher
degree families of lines.
We will see that any planar rational curve can be expressed
as the intersection of two families of lines.
This extension leads to a more efficient implicitization
algorithm for curves, in which, for example, the implicit
equation of a degree 4 rational curve can generally be
6
expressed as the determinant of a 2 × 2 matrix.
Some Definitions
Homogeneous coordinate 𝑋, 𝑌, 𝑊 →
𝑋 𝑌
Cartesian coordinate 𝑥, 𝑦 =
,
.
𝑊 𝑊
The equation of a line in homogenous form is
𝑎𝑋 + 𝑏𝑌 + 𝑐𝑊 = 0
Cross product:
𝑎, 𝑏, 𝑐 × 𝑑, 𝑒, 𝑓 = 𝑏𝑓 − 𝑒𝑐, 𝑑𝑐 − 𝑎𝑓, 𝑎𝑒 − 𝑑𝑏
Dot product:
𝑎, 𝑏, 𝑐 ∙ 𝑑, 𝑒, 𝑓 = 𝑎𝑑 + 𝑏𝑒 + 𝑐𝑓
7
Duality
A point 𝑃 = 𝑋, 𝑌, 𝑊 lies on the line 𝐿 = (𝑎, 𝑏, 𝑐) iff 𝑃 ∙ 𝐿
= 0. 𝑃 ∙ 𝐿 = 𝑎𝑋 + 𝑏𝑌 + 𝑐𝑊
The line 𝐿 containing two points 𝑃1 = (𝑋1 , 𝑌1 , 𝑊1 ) and 𝑃2
= 𝑋2 , 𝑌2 , 𝑊2 :
𝐿 = 𝑃1 × 𝑃2
The point 𝑃 at which two lines 𝐿1 = 𝑎1 , 𝑏1 , 𝑐1
= 𝑎2 , 𝑏2 , 𝑐2 intersect:
𝑃 = 𝐿1 × 𝐿2
and 𝐿2
8
𝑷 𝒕 = 𝑿 𝒕 ,𝒀 𝒕 ,𝑾 𝒕
A homogeneous point whose coordinates are functions of a
variable
Which amounts to the rational curve
moving point
𝑥=
𝑋𝑡
𝑊[𝑡]
𝑦=
𝑌𝑡
𝑊[𝑡]
𝑳 𝒕 = (𝒂 𝒕 , 𝒃 𝒕 , 𝒄 𝒕 )
Denotes the family of lines
moving line
𝑎 𝑡 𝑥+𝑏 𝑡 𝑦+𝑐 𝑡 =0
9
A moving point 𝑃 𝑡 follows a moving line 𝐿 𝑡
if
𝑃 𝑡 ∙𝐿 𝑡 ≡0
That is, if point 𝑃 𝑡 lies on the line 𝐿[𝑡] for all values of 𝑡.
Two moving points 𝑃1 [𝑡] and 𝑃2 [𝑡] follow a moving line 𝐿 𝑡
if
𝑃1 𝑡 × 𝑃2 𝑡 ≡ 𝐿 𝑡 𝑘 𝑡
Two moving lines 𝐿1 [𝑡] and 𝐿2 [𝑡] intersect at a moving point
𝑃[𝑡] if
𝐿1 [𝑡] × 𝐿2 [𝑡] ≡ 𝑃 𝑡 𝑘[𝑡]
10
Pencil of lines
𝐿0 = 𝑎0 , 𝑏0 , 𝑐0
𝐿1 = (𝑎1 , 𝑏1 , 𝑐1 )
𝐿 𝑡 = 𝐿0 1 − 𝑡 + 𝐿1 𝑡
The parameter line is a degree
one polynomial Bezier curve
which follows 𝐿 𝑡 .
𝑃 𝑡 = 1 − 𝑡 𝑃0 + 𝑡𝑃1
𝐿𝑡
passes through the parameter line at the point
corresponding to 𝑡. Thus, every pencil of lines follows a
11
degree 1 polynomial curve.
Intersection of two pencils
To each value of 𝑡 corresponds exactly one line
from each pencil and those two lines intersect in a point.
The locus of the points created for −∞ ≤ 𝑡 ≤ ∞ is a conic
section.
12
𝐿0 𝑡 = 𝐿00 1 − 𝑡 + 𝐿01 𝑡
𝐿1 𝑡 = 𝐿10 1 − 𝑡 + 𝐿11 𝑡
This conic section can be expressed as a rational Bezier curve
𝑃[𝑡].
𝑃 𝑡 = 𝐿0 𝑡 × 𝐿1 𝑡
= 𝐿00 1 − 𝑡 + 𝐿01 𝑡 × 𝐿10 1 − 𝑡 + 𝐿11 𝑡
1
2
= 𝐿00 × 𝐿10 1 − 𝑡 + 𝐿00 × 𝐿11 + 𝐿01 × 𝐿10 2 1 − 𝑡 𝑡
2
+ 𝐿01 × 𝐿11 𝑡 2
13
𝑷 𝒕 = 𝑳𝟎𝟎 × 𝑳𝟏𝟎 𝟏 − 𝒕
𝟐
+
𝟏
𝑳𝟎𝟎 × 𝑳𝟏𝟏 + 𝑳𝟎𝟏 × 𝑳𝟏𝟎 𝟐 𝟏 − 𝒕 𝒕 + 𝑳𝟎𝟏 × 𝑳𝟏𝟏 𝒕𝟐
𝟐
Which expresses 𝑃[𝑡] as a quadratic rational
Bezier curve whose control points are
𝑃0 = 𝐿00 × 𝐿10
1
1
𝑃1 = 𝐿00 × 𝐿11 + 𝐿01 × 𝐿10 = (𝑃𝑎 + 𝑃𝑏 )
2
2
𝑃2 = 𝐿01 × 𝐿11
14
The two pencils provide an intermediate way to
represent of a conic section:
𝐿00 1 − 𝑡 + 𝐿01 𝑡 = 0,
𝐿10 1 − 𝑡 + 𝐿11 𝑡 = 0
𝐿𝑖𝑗 = 𝐿𝑖𝑗 ∙ 𝑃 = 𝑎𝑖𝑗 𝑋 + 𝑏𝑖𝑗 𝑌 + 𝑐𝑖𝑗 𝑊
In matrix form,
𝐿00
𝐿10
𝐿01
𝐿11
1−𝑡
=0
𝑡
So the implicit equation of the intersection locus is:
𝐿00 𝐿11 − 𝐿01 𝐿10 = 0
15
Pencils on quadratic curves
An arbitrary rational quadratic Bezier curve:
𝑃 𝑡 = 𝑃0 1 − 𝑡
2
+ 𝑃1 2 1 − 𝑡 𝑡 + 𝑃2 𝑡 2
Can be represented as the intersection of two pencils.
Consider a moving line 𝑳[𝒕] which goes through a certain
fixed point 𝑷[𝒌] on the curve and follows the moving point
𝑷[𝒕].
𝐿 𝑡 =𝑃 𝑘 ×𝑃 𝑡
= 𝑃0 1 − 𝑘 2 + 𝑃1 2 1 − 𝑘 𝑘 + 𝑃2 𝑘 2
× 𝑃0 1 − 𝑡 2 + 𝑃1 2 1 − 𝑡 𝑡 + 𝑃2 𝑡 2
𝟐𝑷𝟎 × 𝑷𝟏 𝑷𝟎 × 𝑷𝟐
= 𝒕−𝒌 𝟏−𝒌 𝒌
𝑷𝟎 × 𝑷𝟐 𝟐𝑷𝟏 × 𝑷𝟐
𝟏−𝒕
𝒕
16
𝟐𝑷𝟎 × 𝑷𝟏
𝑳 𝒕 = 𝒕−𝒌 𝟏−𝒌 𝒌
𝑷𝟎 × 𝑷𝟐
𝑷𝟎 × 𝑷𝟐
𝟐𝑷𝟏 × 𝑷𝟐
𝟏−𝒕
𝒕
𝐿[𝑡] is equivalent to a linear moving line (pencil).
Thus, two pencils can be found by choosing arbitrary two
parameter values 𝑘0 and 𝑘1 and calculating 𝑃 𝑘𝑖 × 𝑃 𝑡 .
17
Moving lines: Bernstein form
𝐿 𝑡 = (𝑎 𝑡 , 𝑏 𝑡 , 𝑐 𝑡 )
If the polynomials 𝑎 𝑡 , 𝑏 𝑡 and 𝑐 𝑡 are polynomials of
degree 𝑛, one way to define the moving line is to use 𝑛 + 1
control lines 𝐿𝑖 where
𝑛
𝐿𝑖 𝐵𝑖𝑛 [𝑡]
𝐿𝑡 =
𝑖=0
18
Intersection of two moving lines
Two moving lines 𝐿0 [𝑡] and 𝐿1 [𝑡] of degree
𝑚 and 𝑛 respectively, intersect at a moving point
𝑃 𝑡 = 𝐿0 𝑡 × 𝐿1 [𝑡]
Whose degree is generally 𝑛 + 𝑚.
𝑚
𝐵𝑖𝑚 𝑡 𝐿0𝑖
𝐿0 𝑡 =
𝑃𝑡 =
𝐵𝑘
𝑚+𝑛
𝑘=0
𝐿𝑘 =
𝐵𝑗𝑛 𝑡 𝐿1𝑗
𝐿1 𝑡 =
𝑖=0
𝑚+𝑛
𝑛
𝑗=0
𝑡 𝐿𝑘
1
𝑚+𝑛
𝑘
𝑖+𝑗=𝑘
𝑚
𝑖
𝑛
𝑃𝑖 × 𝑄𝑗
𝑗
19
Base Points and Axial moving lines
Any parameter value for which 𝑃 𝑡 = (0,0,0)
or 𝐿 𝑡 = (0,0,0) is called a base point.
Any curve or moving line which has a base point can be
replaced by an equivalent curve or moving point of degree one
less.
When the line has an axis (a single point at which it rotates)
then the line is referred to as an axial moving line.
A degree 𝑛 axial moving line 𝐿[𝑡] can be expressed as:
𝐿 𝑡 = 𝑃𝐴 × 𝑃[𝑡]
20
Curve representation with two
moving lines
Consider an axial moving line 𝐿 𝑡 that follows
a degree 𝑛 Bezier curve 𝑃 𝑡 :
𝐿 𝑡 = 𝑃𝐴 × 𝑃[𝑡]
If the axis lies on the curve 𝑃𝐴 = [𝜏], the degree of the moving
line can be reduced to 𝑛 − 1 because then the moving line has
a base point.
In general, if the axis is on a point of multiplicity 𝑚, then the
degree of the axial moving line which follows the degree 𝑛
curve is 𝑛 − 𝑚.
21
Axial moving line on
a double point.
This cubic Bezier curve has a double point at 𝑃3 .
Thus, the axial moving line with the axis 𝑃3 is a pencil:
𝐿 𝑡 = 𝑃3 × 𝑃 𝑡
= 3,0,1
× 0,0,1 1 − 𝑡
3
+ 0,1,1 3 1 − 𝑡 2 𝑡 + 1,2,1 3 1 − 𝑡 𝑡 2
22
For example, for cubic Beziers,
𝐿 𝑡 = 𝑃 𝜏 × 𝑃 𝑡 = 𝑡 − 𝜏 1 − 𝜏 2 1 − 𝜏 𝜏 𝜏2
3𝑃0 × 𝑃1
3𝑃0 × 𝑃2
𝑃0 × 𝑃3
1−𝑡 2
3𝑃0 × 𝑃2 𝑃0 × 𝑃3 + 9𝑃1 × 𝑃2 3𝑃1 × 𝑃3
1−𝑡 𝑡
𝑃0 × 𝑃3
3𝑃1 × 𝑃3
3𝑃2 × 𝑃3
𝑡2
Where 𝑃𝑖 (𝑖 = 0,1,2,3) are the control points of the Bezier
curve.
23
In general:
𝐿 𝑡 = 𝑡−𝜏
1−𝜏
𝐿0,0
⋮
𝐿𝑛−1,0
𝑛−1
⋯
⋱
⋯
1 − 𝜏 𝜏 … 𝜏 𝑛−1
𝑛−1
1
−
𝑡
𝐿0,𝑛−1
𝑛−2 𝑡
1
−
𝑡
⋮
⋮
𝐿𝑛−1,𝑛−1
𝑡 𝑛−1
The determinant of
this 𝑛 × 𝑛 matrix is
equivalent to
Bezout’s resultant.
Where
𝐿𝑖,𝑗 =
𝑙+𝑚=𝑖+𝑗+1
𝑛
𝑙
𝑛
𝑃𝑙 × 𝑃𝑚
𝑚
24
Cubic curves
For any rational cubic Bezier curve, we can find a pencil and a
quadratic moving line which intersect at the moving points.
Let’s calculate them for our example: We first make axial
moving lines which follow the moving point:
𝑃 𝜏 ×𝑃 𝑡 = 𝑡−𝜏 1−𝜏
−3,0,0
−6,3,0
−6,3,0
−9,12, −9
0,3,0
3,9, −9
2
1 − 𝜏 𝜏 𝜏2
0,3,0
1−𝑡 2
3,9, −9
1−𝑡 𝑡
6,6, −18
𝑡2
25
This moving line follows 𝑃[𝑡] for any 𝜏, so the
following equation is obtained:
−3,0,0
−6,3,0
0,3,0
−6,3,0
−9,12, −9
3,9, −9
0,3,0
3,9, −9
6,6, −18
1−𝑡 2
0
1−𝑡 𝑡 ∙𝑃 𝑡 = 0
0
𝑡2
−3,0,0
−6,3,0
0,0,0
−6,3,0
−9,12, −9
0,3,0
0,3,0
3,9, −9
3,3, −9
1−𝑡 2
0
1−𝑡 𝑡 ∙𝑃 𝑡 = 0
0
𝑡2
Now the bottom moving line has a base point at 𝑡 = 0 and it is
reducible to a linear moving line
1−𝑡
0
0,3,0 3,3, −9
∙𝑃 𝑡 =
26
𝑡
0
Quartic curves
Any quartic rational Bezier curve can
be expressed either with two quadratic
moving lines, or with one linear and one cubic moving line.
Calculate four cubic moving lines which follow the curve by:
−4,0,0
−12,6,0
−8,12,0
0,2,0
−4,0,0
−12,6,0
0,0,0
0,0,0
−12,6,0
−32,36, −24
−16,50, −48
4,8, −8
−12,6,0
−32,36, −24
0,2,0
8,6,0
−8,12,0
−16,50, −48
4,56, −104
12,6, −24
−8,12,0
−16,50, −48
4,4, −8
28,4, −24
0,3,0
3,9, −9
12,6, −24
8, −4, −16
0,3,0
3,9, −9
4, −2, −8
20, −14, −40
1−𝑡 3
0
2
1−𝑡 𝑡
0
∙
𝑃
𝑡
=
0
1 − 𝑡 𝑡2
0
𝑡3
1−𝑡 3
0
2
1−𝑡 𝑡
0
∙
𝑃
𝑡
=
0
1 − 𝑡 𝑡2
0
𝑡3
27
Cont.
From which we can obtain two quadratic moving
lines:
0,2,0
8,6,0
4,4, −8
28,4, −24
4, −2, −8
20, −14, −40
1−𝑡 2
0
∙
𝑃
𝑡
=
1−𝑡 𝑡
0
2
𝑡
That follow the curve, and hence which intersect at the curve.
If the moving line is axial, then the axis is a double point.
28
If there is a triple point on the curve,
there is no pair of quadratic curves
that can represent the curve.
For example, This curve has a double point at 𝑃4 :
We can obtain four cubic moving lines that follow the curve.
−4,0,0
−12,6,0
−8,12,0
2,3,0
−12,6,0
−32,36, −24
−14,51, −48
12,12, −12
−8,12,0
2,3,0
−14,51, −48 12,12, −12
(12,60, −108) 24,12, −28
24,12, −48
16,0, −48
1−𝑡 3
0
2
1−𝑡 𝑡
0
∙
𝑃
𝑡
=
0
1 − 𝑡 𝑡2
0
𝑡3
From which we can obtain the two moving lines:
2,3,0
8,12,0
8,6, −12
30,21, −48
8,0, −24
28,0, −84
1−𝑡 2
0
∙
𝑃
𝑡
=
1−𝑡 𝑡
0
2
𝑡
29
These two quadratic moving lines (call them 𝐿1
and 𝐿2 ) are linearly independent, but their intersection does
not express the curve because all control point obtained from
𝐿1 × 𝐿2 are 0,0,0 .
In fact, each of them has a base point and both are identical to
the same pencil.
The pencil can be obtained by eliminating the bottom left
element:
1−𝑡 2
0
0,0,0
2,3,0
−4,0,12
1−𝑡 𝑡 ∙𝑃 𝑡 = 0
0 30
𝑡2
The general case
The method for cubic curve can be extended to
higher degree curves. For a degree 𝑛 curve, there
exists an 𝑛 parameter family of moving lines whose degree is
𝑛 − 1. A basis for that family of moving lines is given by
𝐿0,0
𝐿1,0
⋮
𝐿𝑛−1,0
𝐿0,1 …
𝐿0,𝑛−1
𝐿1,1 …
𝐿1,𝑛−1
⋮
⋮
𝐿𝑛−1,1 … 𝐿𝑛−1,𝑛−1
Where
𝐿𝑖,𝑗 =
𝑙+𝑚=𝑖+𝑗+1
1 − 𝑡 𝑛−1
0
1 − 𝑡 𝑛−2 𝑡 ∙ 𝑃 𝑡 = 0
⋮
⋮
0
𝑡 𝑛−1
𝑛
𝑙
𝑛
𝑃𝑙 × 𝑃𝑚
𝑚
31
𝐿0,0
𝐿1,0
⋮
𝐿𝑛−1,0
𝐿0,1 …
𝐿0,𝑛−1
𝐿1,1 …
𝐿1,𝑛−1
⋮
⋮
𝐿𝑛−1,1 … 𝐿𝑛−1,𝑛−1
1 − 𝑡 𝑛−1
0
1 − 𝑡 𝑛−2 𝑡 ∙ 𝑃 𝑡 = 0
⋮
⋮
0
𝑡 𝑛−1
By calculating linear combinations of these rows of the 𝑛 × 𝑛
matrix, we can always zero out all but two elements in the first
column:
𝐿0,0
𝐿1,0
0
⋮
0
𝐿0,1 …
𝐿1,1 …
𝐿2,1
⋮
𝐿𝑛−1,1
1
1
𝐿0,𝑛−1
𝐿1,𝑛−1
𝐿2,𝑛−1
⋮
1
… 𝐿𝑛−1,𝑛−1
1
1 − 𝑡 𝑛−1
0
1 − 𝑡 𝑛−2 𝑡 ∙ 𝑃 𝑡 = 0
⋮
⋮
0
𝑡 𝑛−1
32
Cont.
𝑘
𝐿𝑖,𝑗
denotes the element after the 𝑘-th calculation.
Now, we have 𝑛 − 2 moving lines whose degree is 𝑛 − 1:
𝐿2,1 1
𝐿3,1
⋮
⋮
1
𝐿𝑛−1,1
1
𝐿2,2
1
𝐿3,2
1
⋮
⋮
𝐿𝑛−1,2
…
𝐿2,𝑛−1 1
…
1
1
𝐿3,𝑛−1
⋮
⋮
… 𝐿𝑛−1,𝑛−1
1
1 − 𝑡 𝑛−2
0
1 − 𝑡 𝑛−3 𝑡 ∙ 𝑃 𝑡 = 0
⋮
⋮
0
𝑡 𝑛−2
In this 𝑛 − 2 × (𝑛 − 1) matrix, it turns out that we can again
zero out all but two elements of the first column, since, all the
lines contain the point 𝑃0 !
33
Magic! Why is that?
By evaluating our set of equations at 𝑡 = 0 we get:
𝐿2,1
𝐿3,1
⋮
1
1
𝐿𝑛−1,1
1
0
∙𝑃 0 = 0
⋮
0
This zeroing process can be repeated until one or two rows
remain!
34
The zeroing process
If the degree is 𝑛 = 2𝑚, we can repeat the element zeroing
process 𝑚 − 1 times and obtain two degree 𝑚 moving lines.
𝐿𝑛−2,𝑚−1
𝑚−1
𝑚−1
𝐿𝑛−2,𝑚
𝑚−1
𝑚−1
𝐿𝑛−1,𝑚−1
𝐿𝑛−1,𝑚
1 − 𝑡 𝑛−1
1 − 𝑡 𝑛−2 𝑡 ∙ 𝑃 𝑡 = 0
0
⋮
𝑡 𝑛−1
… 𝐿𝑛−2,𝑛−1
… 𝐿𝑛−1,𝑛−1
𝑚−1
𝑚−1
35
If the degree is 𝑛 = 2𝑚 + 1, we can repeat the zero out
process 𝑚 times. This time, only one element can be
eliminated in the last step, and thus, the bottom two rows
express degree 𝑚 + 1 and degree 𝑚 moving lines
𝐿𝑛−2,𝑚−1
𝑚−1
𝑚−1
𝐿𝑛−2,𝑚
𝑚−1
𝑚−1
𝐿𝑛−1,𝑚−1
𝐿𝑛−1,𝑚
1 − 𝑡 𝑛−1
1 − 𝑡 𝑛−2 𝑡 ∙ 𝑃 𝑡 = 0
0
⋮
𝑛−1
… 𝐿𝑛−2,𝑛−1
… 𝐿𝑛−1,𝑛−1
𝑚−1
𝑚−1
36
Implicitization
We can implicitize a rational Bezier curve using
a pair of moving lines.
A point lies on the curve 𝑃 𝑡 if and only if it lies on both
moving lines.
𝐿𝑛−2,𝑚−1
𝐿𝑛−1,𝑚−1
𝑚−1
𝑚−1
∙𝑃
𝐿𝑛−2,𝑚
∙𝑃
𝐿𝑛−1,𝑚
𝑚−1
𝑚−1
∙𝑃
… 𝐿𝑛−2,𝑛−1
∙𝑃
… 𝐿𝑛−1,𝑛−1
𝑚−1
𝑚−1
∙𝑃
∙𝑃
1 − 𝑡 𝑛−1
1 − 𝑡 𝑛−2 𝑡 = 0
0
⋮
𝑡 𝑛−1
This is equivalent to saying that if 𝑃 = (𝑥, 𝑦, 1) lies on the
curve, then there exists a value of 𝑡 which satisfies both
equations, which means that the resultant of the two equations
is zero.
37
faster
𝑛
𝑛
× determinant
2
2
The new method
𝑛 × 𝑛 determinant
The conventional method
38
39
Download