requirements to a line smoothing method although it is a string of line segments, the visual...
TRANSCRIPT
Requirements to a Line Requirements to a Line Smoothing MethodSmoothing Method
• Although it is a string of line segments, the visual impression of it should be a smooth line
• Not only the pieces of a line between the given adjacent points should be connected, the derivatives of at least the first order must be continuous at the junction points
• The figures of the lines on the two sides of a junction point and near to it should be symmetric
• Be able to avoid self-intersection as much as possible
五五点求导分段点求导分段三次多项式曲线光滑法三次多项式曲线光滑法
Piecewise Line Smoothing Using Third Order Polynomials with Derivatives from Five Points
Third Order Polynomials with Derivatives from Five Points (1)
• The basic principle of this method is to set up a third order polynomial equation for a curve between two successive points, and it is demanded that the whole line has the continuous first order derivatives to insure the smoothness of the line.
• The first order derivatives on each of the two successive points is determined by this point plus last two points and next two points (5 points altogether).
Third Order Polynomials with Derivatives from Five Points (2)
• The stipulated geometric condition for the tangential line passing through the middle point:
DB
DP
CA
CP 42
P1
P2
P3
P4
P5
A
B
C
D
Third Order Polynomials with Derivatives from Five Points (3)
• Through mathematical derivation, the derivative t3 on the point P3 can be expressed as:
122112
344334
123342
1
1
3322
33223
)3,2(
babaS
babaS
SwSw
iyyb
xxawhere
awaw
bwbwt
iii
iii
Third Order Polynomials with Derivatives from Five Points (4)
In order to be convenient, we use cosθ3 and sinθ3 for t3
(i.e., tgθ3), and the numerator and the denominator of the expression for t3 are seen as the two edges of a right triangle:
θa0
b0(a0
2 +b02 )1/2
)4,3,2,1(
/cos/sin
11
1221334432
3322033220
20
2003
20
2003
iyybxxa
babawbabaw
bwbwbawawawhere
baabab
iiiiii
When w2=w3=0, cos θ3 and sin θ3 are uncertain, let w2=w3=1
Third Order Polynomials with Derivatives from Five Points (5)
Let the third order polynomial equations between the two successive points Pi and Pi+1 be:
x=p0+p1z+p2z2+p3z3
y=q0+q1z+q2z2+q3z3
In these equations, pi, qi (i=0,1,2,3) are constants, z is the parameter, when the curve is being generated from Pi (xi, yi) to Pi+1 (xi+1, yi+1), z is changing from 0 to 1.
Third Order Polynomials with Derivatives from Five Points (6)
θi
θi+1
Pi
Pi+1
These equations should satisfy the following conditions:
When z=0, x=xi, y=yi, dx/dz=rcosθi, dy/dz=rsinθi,
When z=1, x=xi+1, y=yi+1, dx/dz=rcosθi+1, dy/dz=rsinθi+1.
Where r=[(xi+1-xi)2+(yi+1-yi)2]1/2
From these conditions, pi and qi (i=0,1,2,3) can be uniquely defined:
p0=xi
p1=rcosθi
p2=3(xi+1-xi)-r(cosθi+1+2cosθi)
p3=-2(xi+1-xi)+r(cosθi+1+cosθi)
q0=yi
q1=rsinθi
q2=3(yi+1-yi)-r(sinθi+1+2sinθi)
q3=-2(yi+1-yi)+r(sinθi+1+sinθi)
Third Order Polynomials with Derivatives from Five Points (7)
• Supplement of two points on each end for an open line
– Suppose that the first three given points (x3,y3), (x4, y4), (x5, y5), and the two points to be supplied (x2,y2) and (x1,y1) are all on the following line:
x=g0+g1z+g2z2
y=h0+h1z+h2z2
Third Order Polynomials with Derivatives from Five Points (8)
where gk, hk (k=0,1,2) are constants, z is the parameter, and suppose that when z=j, x=xj, y=yj (j=1,2,3,4,5), then:
x2=3x3-3x4+x5
x1=3x2-3x3+x4
y2=3y3-3y4+y5
y1=3y2-3y3+y4
Third Order Polynomials with Derivatives from Five Points (9)
The supplement of the points after the last given point is similar to this.
• Advantages:
– To be strict mathematically
– Relatively simple in calculation
– The resulted curve can pass through every given point exactly while has the continuous first order derivatives everywhere on the line
– When given points are relatively dense, the resulted curve will be satifactory
Third Order Polynomials with Derivatives from Five Points (10)
• Disadvantages:
– The graphic representation would not be ideal at the place of the sudden turning of the curve
– For the successive zigzag meanders, the curve sometimes intersects with itself
Third Order Polynomials with Derivatives from Five Points (11)
三点求导分段三点求导分段三次多项式曲线光滑法三次多项式曲线光滑法
Piecewise Line Smoothing Using Third Order Polynomials with Derivatives from Three Points
Third Order Polynomials with Derivatives from Three Points (1)
The basic principle of this method is similar with the method used in the piecewise line interpolation using the three order polynomial with derivatives from five points. The main difference lies in the method of determination for the derivatives.
• The derivative on every given point is determined by the relative positions of the last and next points to this point. Therefore, three successive points are used to calculate the derivative of the curve on the middle point
• Let the three points be Pi-1, Pi, Pi+1, their coordinates are (xi-1, yi-1), (xi, yi), (xi+1, yi+1) respectively
Third Order Polynomials with Derivatives from Three Points (2)
Third Order Polynomials with Derivatives from Three Points (3)
Suppose that there is a point M (xm, ym) on the
u
yuyy
u
xuxx
bynedtermidebecanMtPointheofpositionthe
yyxx
yyxx
PP
PPuLet
MP
MP
PP
PP
makesandPP
ii
m
ii
m
iiii
iiii
ii
ii
i
i
ii
ii
ii
11
,
1111
2
1
2
1
2
1
2
1
1
1
1
1
1
1
11
Third Order Polynomials with Derivatives from Three Points (4)
O X
Y
αi
αi+1
Pi-1
Pi
Pi+1
Pi+2
E
F
Ti
Ti+1
M
The slope of the line segment PiM is:
KPiM = (ym-yi) / (xm-xi)
therefore, the slope of the tangential line
on point Pi is:
KEF = -1 / KPiM
Let the direction of EF be identical with the moving direction of the curve.
Third Order Polynomials with Derivatives from Three Points (5)
After the quadrant judgement, the angle
αbetween the directed line EF and the X-axis can be uniquely determined
within the range of 0 - 2π. tgαis the first order derivative at the point Pi on the curve.
All the derivatives tgαi (i=2,3,...,N-1) can be calculated in this way.
Third Order Polynomials with Derivatives from Three Points (6)
The establishment of the parametric equations of the third order polynomials is just like the way for setting up the equations for the third order polynomials with derivatives from five points.
Third Order Polynomials with Derivatives from Three Points (7)
Attention must be paid to:• For an open line, the derivative of the first or last
point can be seen as the slope of the tangential line on the first or last point of a circle or a parabolic line which passes through the first three points or the last three points
• For special cases such as three successive points locate on a same straight line, or the slope of the line segment KPiM
is nearly infinitive, judgement and assignment must be made in advance
Third Order Polynomials with Derivatives from Three Points (8)
r can be changed in order to change the tightness of the curve. Therefore, in order to regulate the tightness of the curve in time, the two angles which are formed by the string Pi-1PiPi+1Pi+2 are used as the components of the weight function to regulate the value of r, called r’:
r’ = r · |(1-z)sinβi+zsinβi+1|
Third Order Polynomials with Derivatives from Three Points (9)
Third Order Polynomials with Derivatives from Three Points
(10)
βi βi+1
r’ = r · |(1-z)sinβi+zsinβi+1|
• Advantages:– This method can give satisfactory result even if the
given points are distributed relatively sparse– The curve passes through all the given points– The first order derivatives are continuous at
everywhere on the curve– Graphical symmetry near every point– The ability to avoid self intersection – To be simple in mathematic principle and easy to
write the program
Third Order Polynomials with Derivatives from Three Points (11)
Third Order Polynomials with Derivatives from Three Points (12)
Questions for Review (1)Questions for Review (1)
• What are the general requirements for line smoothing?
• What are the advantages and disadvantages of weighted average of normal axis parabolic lines?
• What are the differences between the methods of piecewise line smoothing using third order polynomials with derivatives from five and from three points?
• Please describe the concrete steps of line smoothing using third order polynomials with derivatives from three points.
• How are the derivatives calculated using the “five point method“?
• How are the derivatives calculated using the “three point method“?
• What are the frame conditions with respect to the change of parameter z in the third order polynomial line smoothing?
Questions for Review (2)Questions for Review (2)