Download presentation
Presentation is loading. Please wait.
Published byEmery Wells Modified over 6 years ago
1
Efficient Methods for Roots of Univariate Scalar Beziers
Jinesh Machchhar and Gershon Elber Faculty of Computer Science, Technion-Israel Institute of Technology Center for Graphics and Geometric Computing, Technion
2
Center for Graphics and Geometric Computing, Technion
Outline Motivation Traditional approach Our approach Results Extension to B-splines Extension w/o subdivision Discussion Center for Graphics and Geometric Computing, Technion
3
Center for Graphics and Geometric Computing, Technion
Zeros of polynomials Defining manifolds implicitly: E.g. π₯ 2 +3 π¦ 2 β1=0 Offsets, blends, Minkowski-sums: Intersection of manifolds: Kinematic analysis/synthesis: Center for Graphics and Geometric Computing, Technion
4
Center for Graphics and Geometric Computing, Technion
Previous methods Some roots are complex, in this work we look only for real roots. The analytic method gives exact roots of polynomials with degree up to 5. Numeric methods such as Newton-Raphson cannot locate all the roots in interval. Sub-division based methods: Recursively sub-divide the interval until: Absence of roots is guaranteed in the sub-interval, or Exactly one root is guaranteed in the sub-interval. J. Lane and R. Riesenfeld. Bounds on a polynomial, 1981. T. Sederberg and S. Parry. Comparison of three curve intersection algorithms, 1986. Center for Graphics and Geometric Computing, Technion
5
The Subdivision approaches
Traditional approach Our approach Subdivide at arbitrary location as long as topology not clear (until we verify a single or no solution). We guess a solution (via NR) and exploit the mathematical representation of Bezier with a root at its end. Hence the subdivision is converging slower than can be hoped for (like the bisection method). The high chances of successful guessing and the degree reduction from eliminating the root gives about a x10 boost. Center for Graphics and Geometric Computing, Technion
6
Our approach: Locate a root
Assume root at π‘ 2 is found. π‘ 1 π‘ 2 π(π‘) Center for Graphics and Geometric Computing, Technion
7
Our approach: factoring out roots
Lemma: A degree π scalar Bernstein polynomial π π‘ = π=0 π π π π π,π such that π 0 =0 can be written as π π‘ =π‘ π=0 πβ1 π π π π,πβ1 =π‘ π(π‘), where, π π = π π+1 π π+1 for π=0, β¦,πβ1. β π(π‘) π π‘ Degree reduction: π π‘ of degree π, π π‘ of degree πβ1. Similarly, when π 1 =0, π π‘ = 1βπ‘ π π‘ , π π‘ of degree πβ1. Center for Graphics and Geometric Computing, Technion
8
Our approach: factoring out roots
Proof: Since π 0 =0, the first coefficient, π 0 , is zero, and we have, π π‘ = π=0 π π π π π π‘ π 1βπ‘ πβπ , = π=1 π π π π π π‘ π 1βπ‘ πβπ , =π‘ π=1 π π π π π π‘ πβ1 1βπ‘ πβπ , contβd.. Center for Graphics and Geometric Computing, Technion
9
Our approach: factoring out roots
Proof: contβd. π π‘ =π‘ π=1 π π π π π π‘ πβ1 1βπ‘ πβπ , =π‘ π=0 πβ1 π π+1 π π+1 π‘ π 1βπ‘ πβπβ1 , =π‘ π=0 πβ1 π π+1 π π+1 πβ1 π π‘ π 1βπ‘ πβπβ1 , =π‘ π=0 πβ1 π π π π,πβ1 π‘ , =π‘π π‘ . Center for Graphics and Geometric Computing, Technion
10
Our approach: Sub-divide at root
π π‘ is subdivided at π‘ 2 . π‘ 1 π‘ 2 π(π‘) Center for Graphics and Geometric Computing, Technion
11
Our approach: Sub-divide at root
π π π‘ =β0.2 π 0,4 β0.38 π 1, π 2, π 3,4 +π π 4,4 π π π‘ =π π 0,4 β0.15 π 1,4 β0.4 π 2,4 β0.6 π 3,4 β0.2 π 4,4 π π‘ is subdivided at π‘ 2 . π‘ 2 π‘ 1 π‘ 2 π π (π‘) π π (π‘) Center for Graphics and Geometric Computing, Technion
12
Our approach: Factor-out the root
π πΏ π‘ =β0.2 π 0,3 β0.5 π 1, π 2, π 3,4 π π
π‘ =β0.62 π 0,3 β0.81 π 1,3 β0.8 π 2,3 β0.2 π 3,3 The root at π‘ 2 is factored out from π π π‘ and π π π‘ . π π (π‘) π‘ 1 π π (π‘) π πΏ (π‘) π π
(π‘) Center for Graphics and Geometric Computing, Technion
13
Center for Graphics and Geometric Computing, Technion
The basic algorithm BZF(π, π‘ πππ , π‘ πππ₯ ,π,πΏ) if PurgeProblem(π,π) then //Examine if all coefficients are same sign. return β
; end if π‘ 0 β NumericStep(π, π, 0.5); //Newton Raphson, starting from π‘=0.5. if π‘ 0 β β
then π π , π π β Subdivide(π, π‘ 0 ); π πΏ β Factor1MinusT( π π ); π π
β FactorT( π π ); return BZF π πΏ , π‘ πππ , π‘ 0 ,π, πΏ βͺ { π‘ 0 }βͺ BZF π π
, π‘ 0 , π‘ πππ₯ ,π, πΏ ; else contβd.. π πΏ (π‘) π π
(π‘) Center for Graphics and Geometric Computing, Technion
14
The basic algorithm ..contβd.
else if π‘ πππ₯ β π‘ πππ <πΏ then return β
; end if π‘ 0 β π‘ πππ₯ + π‘ πππ 2 ; π π , π π β Subdivide(π, 0.5); return BZF π π , π‘ πππ , π‘ 0 ,π, πΏ βͺ BZF( π π , π‘ 0 , π‘ πππ₯ ,π, πΏ); Center for Graphics and Geometric Computing, Technion
15
Counting root multiplicities
Assume root at π‘ 2 is found. π(π‘) π‘ 1 π‘ 3 π‘ 2 Center for Graphics and Geometric Computing, Technion
16
Counting root multiplicities
π π π‘ =2.12 π 0,4 β1.9 π 1,4 β0.58 π 2,4 +π π 3,4 +π π 4,4 π π π‘ =π π 0,4 +π π 1,4 β0.58 π 2,4 β1.59 π 3, π 4,4 π π (π‘) π π (π‘) π π‘ is subdivided at π‘ 2 . π‘ 1 π‘ 3 π‘ 2 π‘ 2 Center for Graphics and Geometric Computing, Technion
17
Counting root multiplicities
π πΏ π‘ =2.12 π 0,3 β2.54 π 1,3 β1.16 π 2,3 +π π 3,3 π π
π‘ =π π 0,3 β1.16 π 1,3 β2.12 π 2, π 3,3 π π
(π‘) A root at π‘ 2 is factored out from π π π‘ and π π π‘ . π πΏ (π‘) π‘ 1 π‘ 3 π‘ 2 π‘ 2 Center for Graphics and Geometric Computing, Technion
18
Counting root multiplicities
π πΏπΏ π‘ =2.12 π 0,2 β3.81 π 1,2 β3.5 π 2,2 π π
π
π‘ =β3.5 π 1,3 β3.18 π 2, π 3,3 The second root at π‘ 2 is factored out from π πΏ π‘ and π π
π‘ . π π
π
(π‘) π πΏπΏ (π‘) π‘ 1 π‘ 3 Center for Graphics and Geometric Computing, Technion
19
Counting root multiplicities
BZF(π, π‘ πππ , π‘ πππ₯ ,π,πΏ) if PurgeProblem(π,π) then return β
; end if π‘ 0 β NumericStep(π, π, 0.5); if π‘ 0 β β
then π π , π π β Subdivide(π, π‘ 0 ); π 0 β0; do π π β Factor1MinusT( π π ); π π β FactorT( π π ); π 0 β π 0 +1; while | π π π |<π return BZF π π , π‘ πππ , π‘ 0 ,π, πΏ βͺ { π‘ 0 }βͺ BZF π π , π‘ 0 , π‘ πππ₯ ,π, πΏ ; Center for Graphics and Geometric Computing, Technion
20
Center for Graphics and Geometric Computing, Technion
More extensions Initialization of Newton-Raphson method Control polygon of a Bezier curve approximates the curve. Use zeros of control polygon as seed for NR method. Center for Graphics and Geometric Computing, Technion
21
Center for Graphics and Geometric Computing, Technion
More extensions Searching for roots outside the domain Allow the NR method to go outside the domain. Factor out the roots found outside the domain. Hence reduce the problem complexity. β Center for Graphics and Geometric Computing, Technion
22
Comparison with previous methods
Analytic: Eulerβs method for polynomials of degree up to five. CCI: Intersect the convex-hull of the polynomial with the π‘ β axis, [Sederberg and Parry, 1986]. Convex-hulls Bounding-rectangles Source: [Sederberg & Parry, 1986] Center for Graphics and Geometric Computing, Technion
23
Comparison with previous methods
BZF: Our algorithm. NCZ: Use cones bounding the tangent field of the polynomial, [Sederberg and Meyers, 1988]. Non-overlapping wedges Overlapping wedges Source: [Sederberg & Meyers, 1988] Center for Graphics and Geometric Computing, Technion
24
Results I: Random polynomials
Some of the Bezier polynomials with randomly generated coefficients with degrees between 3 and samples for each degree. Center for Graphics and Geometric Computing, Technion
25
Results I: Random polynomials
#CtrlPt Avg #Roots Analytic CCI NCZ BZF BZF-NRI1 BZF-NRI2 4 0.90 0.31 6.11 12.32 1.17 1.09 1.08 5 1.15 0.48 8.83 16.81 1.53 1.35 1.39 6 1.38 - 10.94 20.45 1.90 1.71 1.78 7 1.50 10.66 23.46 2.16 1.88 1.95 8 1.64 14.23 25.55 2.53 2.25 2.33 10 2.04 19.77 33.58 3.49 2.85 3.03 15 26.84 39.88 4.80 4.20 4.24 20 2.82 42.95 58.17 8.03 6.97 7.01 50 167.54 185.63 37.21 31.24 31.31 100 6.74 342.67 225.62 245.25 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
26
Results II: Degree π with π real roots
Some of the degree π polynomials with π real roots with 3β€πβ€14. One sample per degree. Center for Graphics and Geometric Computing, Technion
27
Results II: Degree π with π real roots
#CtrlPt #Roots Analytic CCI NCZ BZF BZF-NRI1 BZF-NRI2 4 3 0.48 22.59 36.99 3.83 2.83 2.59 5 0.59 43.62 78.57 4.38 4.15 3.74 6 - 43.56 92.04 6.12 4.96 4.72 7 53.10 114.70 6.18 6.40 6.15 8 72.16 136.48 9.10 7.65 7.28 9 93.52 157.09 8.97 8.82 8.80 10 88.21 201.03 12.18 11.06 10.96 11 113.20 195.19 13.80 11.89 12.56 12 107.83 281.53 13.74 14.42 16.35 13 202.44 382.29 15.98 16.59 16.58 14 158.58 306.96 22.65 18.52 19.77 15 166.22 361.96 24.74 22.00 24.31 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
28
Results III: Repeated roots
Degree π polynomials with π real roots with one repeated root. 8β€πβ€20. One sample per degree. Center for Graphics and Geometric Computing, Technion
29
Results III: Repeated roots
#CtrlPt # Unique Roots Analytic CCI NCZ BZF BZF-NRI1 BZF-NRI2 9 7 - 102.90 169.35 8.16 9.87 9.02 10 8 107.82 214.43 10.89 9.84 9.66 11 125.18 211.18 11.34 12.27 12.54 12 774.45 240.14 12.62 13.03 14.02 13 351.35 285.84 14.61 15.06 15.27 14 319.09 20.84 19.75 20.36 15 764.16 295.76 20.11 19.50 18.36 16 408.83 22.11 23.50 22.71 17 415.89 24.34 24.79 26.46 18 537.87 422.28 27.79 27.20 29.35 19 365.31 505.46 36.66 41.34 33.74 20 553.07 38.18 41.47 33.76 21 622.01 554.67 36.33 46.53 37.95 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
30
Results IV: Wilkinsonβs polynomials
Degree 13 Degree 20 #CtrlPt #Roots Analytic CCI NCZ BZF BZF-NRI1 BZF-NRI2 14 13 - 187.66 233.68 14.46 15.79 15.32 21 20 347.11 487.15 40.17 32.89 37.00 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
31
Zeros of B-splines π(π‘) Assume the root between consecutive
knots π‘ 1 and π‘ 2 is found. π‘ 1 π‘ 2 Center for Graphics and Geometric Computing, Technion
32
Center for Graphics and Geometric Computing, Technion
Zeros of B-splines π π π‘ π π π‘ π π π‘ Subdivide at π‘ 1 and π‘ 2 to obtain two B-splines π π π‘ , π π π‘ and a Bezier π π π‘ . π‘ 1 π‘ 2 Center for Graphics and Geometric Computing, Technion
33
Results: Zeros of B-splines
Order Length # Avg. Real Roots SubdivAllKnot SelectiveSubdiv 3 4 1.18 0.012 0.011 7 2.76 0.048 0.040 15 6.14 0.148 0.107 25 10.02 0.234 0.186 120 50.99 2.143 1.007 220 93.59 12.304 2.083 0.95 0.010 0.009 2.28 0.035 5.19 0.126 0.101 9.33 0.214 0.181 45.71 1.047 84.57 12.539 2.188 5 2.13 0.033 5.09 0.129 0.106 8.1 0.217 0.185 42.73 2.214 1.114 76.29 13.264 2.279 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
34
Another extension: No subdivision
Guess a root, π‘ 0 Factor out the root, π π‘ = π(π‘) π‘β π‘ 0 Recurse, π π‘ Reverse Bezier polynomial multiplication to factor out root Center for Graphics and Geometric Computing, Technion
35
Bezier polynomial multiplication
π π‘ = π=0 π π π π π,π π‘ π π‘ = π=0 π π π π π,π π‘ π π‘ =π π‘ π π‘ = π=0 π+π π= max 0,πβπ min π,π π π π πβπ π+π π π π π πβπ π π,π+1 (π‘) Center for Graphics and Geometric Computing, Technion
36
Center for Graphics and Geometric Computing, Technion
Factoring out root Assume root at π‘ 0 is known Express polynomial π‘β π‘ 0 in Bernstein basis as π 0 π 0,1 π‘ + π 1 π 1,1 π‘ , hence, π π‘ = π=0 π+1 π= max 0,πβ1 min π,π π π 1 πβπ π+1 π π π π πβπ π π,π+1 (π‘) π π‘ = π 0 π 0 π 0,π+1 π‘ + π=1 π π πβ1 π+1 π π πβ1 π π π π+1 π π π π 0 π π,π+1 (π‘) + π π π 1 π π+1,π+1 π‘ Center for Graphics and Geometric Computing, Technion
37
Center for Graphics and Geometric Computing, Technion
Factoring out root π π = π 0 π 0 , π=0, π π π+1 π β π πβ1 π 1 π πβ1 π π π 0 , 1β€πβ€π. π π = π π+1 π 1 , π=π, π π+1 π+1 π+1 β π π+1 π 0 π π π π π 1 , πβ1β₯πβ₯0. Center for Graphics and Geometric Computing, Technion
38
Another extension: No subdivision
Assume the root at π‘ 1 is known. π‘ 1 π‘ 2 π(π‘) Center for Graphics and Geometric Computing, Technion
39
Another extension: No subdivision
After factoring out the root at π‘ 1 . π‘ 2 π(π‘) Center for Graphics and Geometric Computing, Technion
40
Results All times in microseconds, averaged over 10000 runs. #CtrlPt
#Roots CagdCrvZeroSet ZerosNoSubdiv 3 2 1.94 1.21 4 3.03 1.72 5 4.01 2.69 6 5.09 3.52 7 6.51 6.33 8 8.27 5.82 9 9.55 8.99 10 12.01 9.05 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
41
Results All times in microseconds, averaged over 10000 runs. #CtrlPt
#Roots CagdCrvZeroSet ZerosNoSubdiv 3 0.78 0.99 0.70 4 0.89 1.41 1.03 5 1.14 1.51 1.39 6 1.37 1.81 1.87 7 1.38 1.96 2.17 8 1.62 2.56 2.70 10 1.84 2.98 3.54 15 2.29 4.89 6.81 20 2.83 8.20 12.77 All times in microseconds, averaged over runs. Center for Graphics and Geometric Computing, Technion
42
Center for Graphics and Geometric Computing, Technion
Future directions Handling numerical instabilities while detecting higher-order multiplicities. Inspect first π coefficients for detecting a multiplicity of order π. Extension to finding zeros of multi-variates. Extension to finding solution of CCI and SSI. Center for Graphics and Geometric Computing, Technion
43
Center for Graphics and Geometric Computing, Technion
Thank You! Center for Graphics and Geometric Computing, Technion
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.