Punjab University Journal of Mathematics (ISSN 1016-2526) Vol. 38(2006) pp. 85-100
Visualization of Surface Data Using Rational Bicubic Spline Malik Zawwar Hussain Department of Mathematics University of the Punjab Lahore - Pakistan E-mail:
[email protected] Maria Hussain Department of Mathematics University of the Punjab Lahore - Pakistan E-mail: mariahussain
[email protected] Abstract. A rational cubic spline [11] is extended to rational bicubic spline. Simple constraints are made on the free parameters in the description of rational bicubic spline to preserve the shape of positive surafac data and to preserve the shape of the data that lie above a plane.
keywords: Visualization, Positive Data, Rational Bicubic Spline. 1. Introduction Scientific visualization is concerned with the presentation of interactive or animated digital images to users to understand data. The advantages of scientific visualization are: huge amount of data is converted into one picture, it correlates different quantities. One of the problems faced by scientific visualization community is visualization of positive data. Visualization of positive data in the view of positive surface is essential in visualizing the entities that cannot be negative e.g. amount of rainfall, volume, area, density, population etc. The problem of visualization of positive data has been considered by many authors [1-14]. But most of the authors considered the problem of visualization of positive scattered data [1,3,4,6,8,9,10,14] only a few have considered the problem of visualization of positive data arranged over rectangular grid [2,13]. A brief review is: Asim, Mustafa and Brodlie [1] visualized positive scattered data subject to positivity constraints using modified quadratic Shepard method. Brodlie, Mashwama and Butt [2] addressed the problem of visualization of positive data arranged over a rectangular mesh. Sufficient conditions for positivity are derived in terms of the first partial derivatives and mixed partial derivatives at the grid points. Brodlie, Asim and Unsworth [3] modified the quadratic Shepard method, which interpolates scattered data of any dimensionality to preserve positivity. Chan and Ong 85
Malik Zawwar Hussain and Maria Hussain
86
[4] described a local scheme for scattered data range restricted interpolation. Sufficient conditions for the non-negativity of cubic Bzier triangle are derived and these conditions prescribed lower bounds to Bzier ordinates. Non-negativity is achieved by modifying if necessary the first order partial derivatives of data sites and some Bzier ordinates. Kong et al [8] discussed the problem of range restricted scattered data interpolation using cubic Bzier triangles. Nadler [9] have considered nonnegative data arranged over a triangular mesh and have interpolated each triangular patch using a bivariate quadratic function. Piah, Goodman and Unsworth [10] constructed the interpolating surfaces comprising cubic Bzier triangular patches. They imposed sufficient conditions on the ordinates of the Bzier control net in each triangle to preserve the positivity. The derivatives at the data points are specified to be consistent with these conditions. Schmidt [13] provided the solution to the problem of shape preserving interpolation of data sets given on rectangular grids. Shepard [14] proposed a basic form that involves an inverse distance-weighted average of data values to visualize the positive data. In Section 2, the rational cubic function [11] used in this paper is rewritten. In Section 3, the rational cubic function is extended to the rational bicubic function. In Section 4, the problem of visualization of positive data has been considered. In Section 5, the problem of visualization constrained data has been considered. Section 6 applies the results developed in Section 4 and 5 graphically. Section 7 concludes the paper. 2. Rational Cubic Spline In this Section, we recall the piecewise rational cubic function used in this paper which was initially developed by Sarfraz [11]. Let (xi , fi ), i = 0, 1, 2, . . . , n be given set of data points where x0 < x1 < x2 < · · · < xn . The piecewise rational cubic function is defined over each interval Ii = [xi , xi+1 ], i = 0, 1, 2, . . . , n − 1 as: S(x) =
pi (θ) , qi (θ)
(2. 1)
with pi (θ) = fi (1 − θ)3 + (αi fi + hi di )(1 − θ)2 θ + (βi fi+1 − hi di+1 )(1 − θ)θ2 qi (θ) =
+ fi+1 θ3 , (1 − θ)3 + αi (1 − θ)2 θ + βi (1 − θ)θ2 + θ3 , hi = xi+1 − xi ,
θ=
x − xi . hi
The rational cubic function (1) has the following properties: S(xi ) = fi , S(xi+1 ) = fi+1 , S (1) (xi ) = di , S (1) (xi+1 ) = di+1 . S (1) (x) denotes the derivative with respect to x and di denotes derivative values (given or estimated by some method) at knot xi . S(x) ∈ C (1) [x0 , xn ] has αi and βi as free parameters in the interval [xi , xi+1 ]. We note that in each interval Ii , when we take αi = 3 and βi = 3, the piecewise rational cubic function reduces to standard Cubic Hermite.
Visualization of Surface Data using Rational Bicubic Spline
87
3. Rational Bicubic Spline The piecewise rational cubic function (2.1) is extended to rational bicubic function S(x, y) over the rectangular domain D = [x0 , xm ] × [y0 , yn ]. Let π : a = x0 < x1 < · · · < xm = b be partition of [a, b] and π ˜ : c = y0 < y1 < · · · < yn = d be partition of [c, d]. The rational bicubic function is defined over each rectangular patch [xi , xi+1 ] × [yj , yj+1 ], where i = 0, 1, 2, . . . , m − 1; j = 0, 1, 2, . . . , n − 1 as: S(x, y) = Si,j (x, y) = Ai (θ)F (i, j)AˆTj (φ),
(3. 1)
where
Fi,j Fi+1,j F (i, j) = x Fi,j x Fi+1,j
Fi,j+1 Fi+1,j+1 x Fi,j+1 x Fi+1,j+1
Ai (θ) = [a0 (θ) a1 (θ) a2 (θ) a3 (θ)],
y Fi,j y Fi+1,j xy Fi,j xy Fi+1,j
y Fi,j+1 y Fi+1,j+1 , xy Fi,j+1 xy Fi+1,j+1
Aˆj (φ) = [ˆ a0 (φ) a ˆ1 (φ) a ˆ2 (φ) a ˆ3 (φ)],
with a0 (θ) =
a ˆ0 (φ) =
θ3 + βi (1 − θ)θ2 , qi (θ) −hi (1 − θ)θ2 a3 (θ) = , qi (θ) φ3 + βˆj (1 − φ)φ2 a ˆ1 (φ) = , qj (φ) ˆ j (1 − φ)φ2 −h a ˆ3 (φ) = . qj (φ)
(1 − θ)3 + αi (1 − θ)2 θ , qi (θ) hi (1 − θ)2 θ a2 (θ) = , qi (θ)
a1 (θ) =
(1 − φ)3 + α ˆ j (1 − φ)2 φ , qj (φ) ˆ j (1 − φ)2 φ h a ˆ2 (φ) = , qj (φ)
Substituting the values of A, F and Aˆ in equation (3.1) the rational bicubic function S(x, y) can be expressed as: S(x, y) =
(1 − θ)3 γi,j + (1 − θ)2 θηi,j + (1 − θ)θ2 δi,j + θ3 ωi,j , (1 − θ)3 + αi (1 − θ)2 θ + βi (1 − θ)θ2 + θ3
(3. 2)
with γi,j
=
P3
i=0 (1
− φ)3−i φi Ai , qj (φ)
A0
= Fi,j ,
A1
ˆj F y , = α ˆ j Fi,j + h i,j
A2 A3
ˆj F y , = βˆj Fi,j+1 − h i,j+1 = Fi,j+1 ,
qj (φ) =
(3. 3)
(1 − φ)3 + α ˆ j (1 − φ)2 φ + βˆj (1 − φ)φ2 + φ3 . ηi,j
=
P3
i=0 (1
− φ)3−i φi Bi , qj (φ)
(3. 4)
Malik Zawwar Hussain and Maria Hussain
88
B0
x = αi Fi,j + hi Fi,j ,
B1
x ˆ j (αi F y + hi F xy ), = α ˆ j (αi Fi,j + hi Fi,j )+h i,j i,j
B2
xy x ˆ j (αi F y = βˆj (αi Fi,j+1 + hi Fi,j+1 )−h i,j+1 + hi Fi,j+1 ),
B3
x = αi Fi,j+1 + hi Fi,j+1 ,
qj (φ) =
(1 − φ)3 + α ˆ j (1 − φ)2 φ + βˆj (1 − φ)φ2 + φ3 . δi,j
=
P3
i=0 (1
− φ)3−i φi Ci , qj (φ)
C0
x = βi Fi+1,j − hi Fi+1,j ,
C1
xy x ˆ j (βi F y = α ˆ j (βi Fi+1,j − hi Fi+1,j )+h i+1,j − hi Fi+1,j ),
C2
xy x ˆ j (βi F y = βˆj (βi Fi+1,j+1 − hi Fi+1,j+1 )−h i+1,j+1 − hi Fi+1,j+1 ),
C3
x = βi Fi+1,j+1 − hi Fi+1,j+1 ,
qj (φ) =
(3. 5)
(1 − φ)3 + α ˆ j (1 − φ)2 φ + βˆj (1 − φ)φ2 + φ3 . ωi,j
=
P3
i=0 (1
− φ)3−i φi Di , qj (φ)
D0
= Fi+1,j ,
D1
ˆj F y , = α ˆ j Fi+1,j + h i+1,j
D2
ˆj F y = βˆj Fi+1,j+1 − h i+1,j+1 ,
D3
= Fi+1,j+1 ,
qj (φ) =
(3. 6)
(1 − φ)3 + α ˆ j (1 − φ)2 φ + βˆj (1 − φ)φ2 + φ3 .
The normalized variables θ and φ along x and y axes are defined as: θ=
x − xi , hi
φ=
y − yj , ˆj h
with hi = xi+1 − xi ,
ˆ j = yj+1 − yj . h
Unfortunately, these rational functions are not very useful for surface design as any one of the free parameter αi , βi , α ˆ j and βˆj applies to the entire network of curves. Thus there is no local control on the surface. This ambiguity is overcome by introducing variable weights and desired local control has been achieved. For this purpose new free parameters αi,j , βi,j , α ˆ i,j and βˆi,j are introduced such that: αi (yj ) = αi,j , βi (yj ) = βi,j , α ˆ j (xi ) = α ˆ i,j , βˆj (xi ) = βˆi,j , i = 0, 1, 2, . . . , m − 1; j = 0, 1, 2, . . . , n − 1. The shape of the surface can be modified by assigning different values to these parameters. This property of free parameters will impose different constraints on αi,j , βi,j , α ˆ i,j and βˆi,j .
Visualization of Surface Data using Rational Bicubic Spline
89
3.1. Choice of Derivatives. In most applications, the derivative parameters di , y xy x Fi,j , Fi,j and Fi,j are not given and hence must be determined either from given data or by some other means. These methods are the approximation based on various mathematical theories. An obvious choice is mentioned here: h0 x , F0,j = ∆0,j + (∆0,j − ∆1,j ) (h0 + h1 ) hm−1 x , Fm,j = ∆m−1,j + (∆m−1,j − ∆m−2,j ) (hm−1 + hm−2 ) ∆i,j + ∆i−1,j x Fi,j = , 2 i = 1, 2, 3, . . . , m − 1; j = 0, 1, 2, . . . , n. ˆ0 h y ˆ i,0 + (∆ ˆ i,0 − ∆ ˆ i,1 ) Fi,0 = ∆ , ˆ0 + h ˆ1) (h ˆ n−1 h y ˆ i,n−1 + (∆ ˆ i,n−1 − ∆ ˆ i,n−2 ) , Fi,n = ∆ ˆ ˆ n−2 ) (hn−1 + h ˆ i,j + ∆ ˆ i,j−1 ∆ y Fi,j = , 2 i = 0, 1, 2, . . . , m; j = 1, 2, 3, . . . , n − 1. ( ) y y x x Fi+1,j − Fi−1,j − Fi,j−1 1 Fi,j+1 xy + Fi,j = , ˆ j−1 + h ˆj 2 hi−1 + hi h i = 1, 2, . . . , m − 1; j = 1, 2, . . . , n − 1. ˆ i,j = Fi,j+1 −Fi,j . These arithmetic mean methods and ∆ Where ∆i,j = ˆj h are computationally economical and suitable for visualization of shaped data. Fi+1,j −Fi,j hi
4. Visualization of Positive Data Let (xi , yj , Fi,j ), i = 0, 1, 2, . . . , m; j = 0, 1, 2, . . . , n be positive data defined over the rectangular grid D = [x0 , xm ] × [y0 , yn ] such that Fi,j > 0
∀i, j.
The rational bicubic function (3.2) preserves the shape of positive data if S(x, y) > 0,
∀(x, y) ∈ D.
S(x, y) > 0 if (1 − θ)3 γi,j + (1 − θ)2 θηi,j + (1 − θ)θ2 δi,j + θ3 ωi,j 3
2
2
qi (θ) = (1 − θ) + αi,j (1 − θ) θ + βi,j (1 − θ)θ + θ qi (θ) > 0 if 3
2
(1 − θ) γi,j + (1 − θ) θηi,j
αi,j > 0, βi,j > 0. + (1 − θ)θ2 δi,j + θ3 ωi,j > 0 if
γi,j > 0,
ηi,j > 0,
δi,j > 0,
ωi,j > 0.
γi,j > 0 if Ai > 0, i = 0, 1, 2, 3 and qj (φ) > 0. qj (φ) > 0 if α ˆ i,j > 0,
βˆi,j > 0.
3
> 0, > 0.
Malik Zawwar Hussain and Maria Hussain
90
Ai > 0, i = 0, 1, 2, 3 if α ˆ i,j βˆi,j
) ˆj F y −h i,j > max 0, . Fi,j ( ) ˆj F y h i,j+1 > max 0, . Fi,j+1 (
ηi,j > 0 if Bi > 0, i = 0, 1, 2, 3 and qj (φ) > 0. qj (φ) > 0 if βˆi,j > 0.
α ˆ i,j > 0, Bi > 0, i = 0, 1, 2, 3 if ( α ˆ i,j
βˆi,j αi,j αi,j
) ˆj F y −h i,j > max 0, . Fi,j ( ) ˆj F y h i,j+1 > max 0, . Fi,j+1 ¾ ½ x x −hi Fi,j+1 −hi Fi,j . , > max Fi,j Fi,j+1 ) ( x ˆ xy ˆ j F xy ) −hi (βˆi,j F x −hi (ˆ αi,j Fi,j +h i,j+1 − hj Fi,j+1 ) i,j . , > max ˆj F y ) ˆj F y ) (ˆ αi,j Fi,j + h (βˆi,j Fi,j+1 − h i,j
i,j+1
δi,j > 0 if Ci > 0, i = 0, 1, 2, 3 and qj (φ) > 0. qj (φ) > 0 if α ˆ i,j > 0,
βˆi,j > 0.
Ci > 0, i = 0, 1, 2, 3 if ( α ˆ i,j
βˆi,j βi,j βi,j
) ˆj F y −h i+1,j > max 0, . Fi+1,j ( ) ˆj F y h i+1,j+1 > max 0, . Fi+1,j+1 ¾ ½ x x hi Fi+1,j+1 hi Fi+1,j , . > max Fi+1,j Fi+1,j+1 ) ( x ˆ xy ˆ j F xy ) hi (βˆi,j F x hi (ˆ αi,j Fi+1,j +h i+1,j+1 − hj Fi+1,j+1 ) i+1,j . , > max ˆj F y ) ˆj F y (ˆ αi,j Fi+1,j + h (βˆi,j Fi+1,j+1 − h ) i+1,j
ωi,j > 0 if Di >, i = 0, 1, 2, 3 and qj (φ) > 0. qj (φ) > 0 if α ˆ i,j > 0,
βˆi,j > 0.
i+1,j+1
Visualization of Surface Data using Rational Bicubic Spline
91
Di > 0, i = 0, 1, 2, 3 if α ˆ i,j βˆi,j
) ˆj F y −h i+1,j . > max 0, Fi+1,j ( ) ˆj F y h i+1,j+1 > max 0, . Fi+1,j+1 (
All this discussion is summarized in the following theorem: Theorem 4.1. The rational bicubic function defined in (3.2) visualizes positive data in the view of positive surface if in each rectangular patch Ii,j = [xi , xi+1 ] × [yj , yj+1 ], the free parameters αi,j , βi,j , α ˆ i,j and βˆi,j satisfy the following conditions: ( ) ˆ j F y −h ˆj F y −h i,j i+1,j α ˆ i,j = li,j + max 0, , , li,j > 0. Fi,j Fi+1,j ( ) ˆj F y ˆ y h i,j+1 hj Fi+1,j+1 ˆ βi,j = qi,j + max 0, , , qi,j > 0. Fi,j+1 Fi+1,j+1 ¾ ½ x x −hi Fi,j+1 −hi Fi,j , . Ai,j = Fi,j Fi,j+1 ) ( x ˆ xy ˆ j F xy ) −hi (βˆi,j F x −hi (ˆ αi,j Fi,j +h i,j+1 − hj Fi,j+1 ) i,j . , Bi,j = ˆj F y ) ˆj F y ) (ˆ αi,j Fi,j + h (βˆi,j Fi,j+1 − h i,j
αi,j Ci,j Di,j βi,j
i,j+1
= mi,j + max {0, Ai,j , Bi,j } , mi,j > 0. ¾ ½ x x hi Fi+1,j+1 hi Fi+1,j . , = Fi+1,j Fi+1,j+1 ) ( x ˆ xy ˆ j F xy ) hi (βˆi,j F x hi (ˆ αi,j Fi+1,j +h i+1,j+1 − hj Fi+1,j+1 ) i+1,j . , = ˆj F y ) ˆj F y (ˆ αi,j Fi+1,j + h (βˆi,j Fi+1,j+1 − h i+1,j i+1,j+1 ) = ni,j + max {0, Ci,j , Di,j } , ni,j > 0.
5. Visualization of Constrained Data Let (xi , yj , Fi,j ), i = 0, 1, 2, . . . , m; j = 0, 1, 2, . . . , n be a given set of data points lying above the plane h yi x Z = C 1− − A B i.e. Fi,j > Zi,j , ∀i, j. It is required that the surface generated by the rational bicubic function (3.2) will lie on the same side of the plane as the data. This situation is expressed mathematically as: h x yi S(x, y) > C 1 − − . (5. 1) A B The parametric equation of the plane is: Z = Zi,j + θ(Zi+1,j − Zi,j ) + φ(Zi,j+1 − Zi,j ),
(5. 2)
Malik Zawwar Hussain and Maria Hussain
92
where
h xi yj i Zi,j = C 1 − . (5. 3) − A B A, B and C are x,y and z intercepts respectively. Substituting the values from (3.2) and (5.2) in (5.1), condition (5.1) is expressed as: (1 − θ)3 γi,j + (1 − θ)2 θηi,j + (1 − θ)θ2 δi,j + θ3 ωi,j (1 − θ)3 + αi,j (1 − θ)2 θ + βi,j (1 − θ)θ2 + θ3
>
Zi,j + θ(Zi+1,j − Zi,j ) + φ(Zi,j+1 − Zi,j ).
After some rearrangement above relation can be expressed as: Ui,j (θ, φ) = λi,j (1 − θ)4 + µi,j (1 − θ)3 θ + νi,j (1 − θ)2 θ2 + χi,j (1 − θ)θ3 + τi,j θ4 , where λi,j =
P4
j=0 (1
− φ)4−j φj Aj qj (φ)
(5. 4)
,
with A0
= Fi,j − Zi,j ,
A1
ˆj F y , = α ˆ i,j (Fi,j − Zi,j ) + Fi,j − Zi,j+1 + h i,j
A2
y ˆ j (F y = α ˆ i,j (Fi,j − Zi,j ) + βˆi,j (Fi,j+1 − Zi,j+1 ) − h i,j+1 − Fi,j )
A3 A4
+(ˆ αi,j − βˆi,j )(Zi,j − Zi,j+1 ), ˆj F y , = βˆi,j (Fi,j+1 − Zi,j+1 ) + Fi,j+1 − Zi,j − h i,j+1 = Fi,j+1 − Zi,j+1 . µi,j =
P4
j=0 (1
− φ)4−j φj Bj qj (φ)
(5. 5)
,
with B0
x = αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ,
B1
x ˆ j F xy = (ˆ αi,j + 1)(αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) + hi h i,j
ˆ j F y + Zi,j − Zi,j+1 ), +(αi,j + 1)(h i,j B2
x = α ˆ i,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) + βˆi,j ((αi,j + 1) x (Fi,j+1 − Zi,j+1 ) + hi Fi,j+1 − Zi+1,j + Zi,j ) + (ˆ αi,j − βˆi,j )(αi,j + 1) ˆ j (F xy − F xy ), ˆ j (F y (Zi,j − Zi,j+1 ) − (αi,j + 1)h − F y ) − hi h
B3
x = (βˆi,j + 1)((αi,j + 1)(Fi,j+1 − Zi,j+1 ) + hi Fi,j+1 − Zi+1,j + Zi,j ) xy y ˆ ˆ + (αi,j + 1)(Zi,j+1 − Zij − hj F ) − h i hj F ,
B4
x = (αi,j + 1)(Fi,j+1 − Zi,j+1 ) + hi Fi,j+1 − Zi+1,j + Zi,j .
i,j+1
i,j+1
i,j
i,j+1
i,j+1
νi,j =
P4
j=0 (1
− φ)4−j φj Cj qj (φ)
i,j
,
(5. 6)
Visualization of Surface Data using Rational Bicubic Spline
93
with C0
x = αi,j (Fi,j − Zi,j ) + βi,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) x x −hi (Fi+1,j − Fi,j ) + (αi,j − βi,j )(Zi,j − Zi+1,j ),
C1
=
x (ˆ αi,j + 1)(αi,j (Fi,j − Zi,j ) + βi,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j x x −Zi+1,j ) − hi (Fi+1,j − Fi,j ) + (αi,j − βi,j )(Zi,j − Zi+1,j )) + αi,j (Zi,j y ˆ j (F xy − F xy ), ˆ ˆ j F y ) − hi h −Zi,j+1 + hj Fi,j ) + βi,j (Zi,j − Zi,j+1 + h i+1,j i,j i+1,j
C2
x = α ˆ i,j (αi,j (Fi,j − Zi,j ) + βi,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) x x −hi (Fi+1,j − Fi,j ) + (αi,j − βi,j )(Zi,j − Zi+1,j )) ˆ +βi,j (αi,j (Fi,j+1 − Zi,j+1 ) + βi,j ((αi,j + 1)(Fi,j+1 − Zi,j+1 ) x +hi Fi,j+1 − Zi+1,j + Zi,j ) + (αi,j − βi,j )(Zi,j − Zi+1j ) x −hi (F − F x )) + (ˆ αi,j − βˆi,j )(αi,j + βi,j )(Zi,j − Zi,j+1 ) i+1,j+1
i,j+1
xy y y y ˆ ˆ j {αi,j (F y −h i,j+1 − Fi,j ) + βi,j (Fi+1,j+1 − Fi+1,j )} + hi hj (Fi+1,j+1 xy xy xy −Fi,j+1 − Fi+1,j + Fi,j ),
C3
=
(βˆi,j + 1)(αi,j (Fi,j+1 − Zi,j+1 ) + βi,j ((αi,j + 1)(Fi,j+1 − Zi,j+1 ) x +hi Fi,j+1 − Zi+1,j + Zi,j ) + (αi,j − βi,j )(Zi,j − Zi+1j ) x x ˆj F y ) − hi (Fi+1,j+1 − Fi,j+1 )) + αi,j (Zi,j+1 − Zi,j − h i,j+1 xy xy ˆ ˆj F y +βi,j (Zi,j+1 − Zi,j − h i+1,j+1 ) + hi hj (Fi+1,j+1 − Fi,j+1 ),
C4
x = αi,j (Fi,j+1 − Zi,j+1 ) + βi,j ((αi,j + 1)(Fi,j+1 − Zi,j+1 ) + hi Fi,j+1 x x −Zi+1,j + Zi,j ) + (αi,j − βi,j )(Zi,j − Zi+1j ) − hi (Fi+1,j+1 − Fi,j+1 ). P4 4−j j φ Dj j=0 (1 − φ) , (5. 7) χi,j = qj (φ)
with D0
x x = βi,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) + Fi+1,j − hi Fi+1,j − Zi,j ,
D1
=
D2
x x = α ˆ i,j (βi,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) + Fi+1,j − hi Fi+1,j − Zi,j ) x +βˆi,j (βi,j ((αi,j + 1)(Fi,j+1 − Zi,j+1 ) + hi F − Zi+1,j + Zi,j ) + Fi+1,j+1
x x (ˆ αi,j + 1)(βi,j (αi,j (Fi,j − Zi,j ) + Fi,j + hi Fi,j − Zi+1,j ) + Fi+1,j − hi Fi+1,j ˆ j F xy , ˆj F y −Zi,j ) + (βi,j + 1)(h − Zi,j+1 + Zi,j ) − hi h i+1,j
i+1,j
i,j+1
x −hi Fi+1,j+1 − Zi,j+1 ) + (ˆ αi,j − βˆi,j )(βi,j + 1)(Zi,j xy y y ˆ j (F xy +1)(Fi+1,j − Fi+1,j+1 ) + hi h i+1,j+1 − Fi+1,j ),
D3
=
ˆ j (βi,j − Zi,j+1 ) + h
x (βˆi,j + 1)(βi,j ((αi,j + 1)(Fi,j+1 − Zi,j+1 ) + hi Fi,j+1 − Zi+1,j + Zi,j ) ˆj F y +Fi+1,j+1 − hi F x − Zi,j+1 ) + (βi,j + 1)(Zi,j+1 − Zi,j − h
i+1,j+1 )
i+1,j+1
ˆ j F xy +hi h i+1,j+1 , D4
x = βi,j ((αi,j + 1)(Fi,j+1 − Zi,j+1 ) + hi Fi,j+1 − Zi+1,j + Zi,j ) + Fi+1,j+1 x −hi Fi+1,j+1 − Zi,j+1 .
τi,j =
P4
j=0 (1
− φ)4−j φj Ej qj (φ)
,
(5. 8)
Malik Zawwar Hussain and Maria Hussain
94
with E0
= Fi+1,j − Zi+1,j ,
E1
=
E2
= α ˆ i,j (Fi+1,j − Zi+1,j ) + βˆi,j (Fi+1,j+1 − Zi+1,j − Zi,j+1 + Zi,j ) y ˆ j (F y ˆ −h ˆ i,j )(Zi,j+1 − Zi,j ), i+1,j+1 − Fi+1,j ) + (βi,j − α
E3
ˆj F y = βˆi,j (Fi+1,j+1 − Zi+1,j − Zi,j+1 + Zi,j ) − h i+1,j+1 + Fi+1,j+1 −Zi+1,j ,
E4
= Fi+1,j+1 − Zi+1,j − Zi,j+1 + Zi,j .
ˆj F y (ˆ αi,j + 1)(Fi+1,j − Zi+1,j ) + h i+1,j − Zi,j+1 + Zi,j ,
Ui,j (θ, φ) > 0 if λi,j > 0, µi,j > 0, νi,j > 0, χi,j > 0, τi,j > 0. λi,j > 0 if 4 X
(1 − φ)4−j φj Aj > 0, qj (φ) > 0.
j=0
qj (φ) > 0 if
α ˆ i,j > 0 and βˆi,j > 0. P4
j=0 (1
4−j j
− φ)
α ˆ i,j = βˆi,j
φ Aj > 0 if ( ˆ j F y + Zi,j+1 −Fi,j+1 + h ˆj F y −Fi,j − h i,j i,j+1 − Zi,j > max , , Fi,j − Zi,j Fi,j+1 − Zi,j+1 ) y ˆ j (F y h i,j+1 − Fi,j ) . (Fi,j − Zi,j )
µi,j > 0 if 4 X
(1 − φ)4−j φj Bj > 0, qj (φ) > 0.
j=0
qj (φ) > 0 if
α ˆ i,j > 0 and βˆi,j > 0. P4
j=0 (1
− φ)4−j φj Bj > 0
α ˆ i,j
= βˆi,j .
αi,j
>
½ x x −Fi,j − hi Fi,j + Zi+1,j −hi Fi,j+1 + Zi+1,j − Zi,j max 0, , , Fi,j − Zi,j Fi,j+1 − Zi,j+1 ) xy xy hi (Fi,j+1 − Fi,j ) . y y (Fi,j − Fi,j+1 )
νi,j > 0 if 4 X
(1 − φ)4−j φj Cj > 0, qj (φ) > 0.
j=0
qj (φ) > 0 if
α ˆ i,j > 0 and βˆi,j > 0.
Visualization of Surface Data using Rational Bicubic Spline
P4
j=0 (1
95
− φ)4−j φj Cj > 0 if α ˆ i,j
= βˆi,j .
αi,j αi,j
= βi,j . = βi,j ½ x x x x − Fi,j+1 ) hi (Fi+1,j − Fi,j ) hi (Fi+1,j+1 , , max 0, (Fi,j − Zi,j ) (Fi,j+1 − Zi,j+1 ) ) xy xy xy xy −hi (Fi,j − Fi+1,j + Fi+1,j+1 − Fi,j+1 ) . y y y y (Fi,j − Fi,j+1 + Fi+1,j − Fi+1,j+1 )
>
χi,j > 0 if 4 X
(1 − φ)4−j φj Dj >, qj (φ) > 0.
j=0
qj (φ) > 0 if α ˆ i,j > 0 and βˆi,j > 0. P4
j=0 (1
α ˆ i,j βi,j
− φ)4−j φj Dj > 0 if
= βˆi,j . >
½
max 0,
x x −Fi+1,j + hi Fi+1,j + Zi,j −Fi+1,j+1 + hi Fi+1,j+1 + Zi,j+1 , , Fi+1,j − Zi+1,j Fi+1,j+1 − Zi,j+1 − Zi+1,j + Zi,j ) xy xy hi (Fi+1,j − Fi+1,j+1 ) . y y (Fi+1,j − Fi+1,j+1 )
τi,j > 0 if 4 X
(1 − φ)4−j φj Ej > 0, qj (φ) > 0.
j=0
qj (φ) > 0 if α ˆ i,j > 0 and βˆi,j > 0. P4
j=0 (1
α ˆ i,j
− φ)4−j φj Ej > 0 if
= βˆi,j
>
max
(
ˆ y ˆj F y −h i+1,j + Zi,j+1 − Zi,j −Fi+1,j+1 + hj Fi+1,j+1 + Zi+1,j , , Fi+1,j − Zi+1,j Fi+1,j+1 − Zi+1,j − Zi,j+1 + Zi,j ) y ˆ j (F y h i+1,j+1 − Fi+1,j ) . (Fi+1,j − Zi+1,j )
All this discussion is summarized in the following theorem. Theorem 5.1. The rational bicubic function (3.2) generates surface that lie on same side of plane as that of data if free parameters αi,j , βi,j , α ˆ i,j and βˆi,j satisfy
Malik Zawwar Hussain and Maria Hussain
96
the following conditions: α ˆ i,j = βˆi,j ˆ j F y + Zi,j+1 −Fi,j+1 + h ˆj F y −Fi,j − h i,j i,j+1 − Zi,j , , Fi,j − Zi,j Fi,j+1 − Zi,j+1 y y y ˆ ˆ y ˆ j (F y h i,j+1 − Fi,j ) −hj Fi+1,j + Zi,j+1 − Zi,j hj (Fi+1,j+1 − Fi+1,j ) , , , (Fi,j − Zi,j ) Fi+1,j − Zi+1,j (Fi+1,j − Zi+1,j ) ˆj F y −Fi+1,j+1 + h i+1,j+1 + Zi+1,j }, gi,j > 0. (5. 9) Fi+1,j+1 − Zi+1,j − Zi,j+1 + Zi,j
= gi,j + max{0,
αi,j = βi,j
x x −Fi,j − hi Fi,j + Zi+1,j −hi Fi,j+1 + Zi+1,j − Zi,j , , Fi,j − Zi,j Fi,j+1 − Zi,j+1 xy xy xy xy x − Fi+1,j+1 ) hi (Fi,j+1 − Fi,j ) −Fi+1,j + hi Fi+1,j + Zi,j hi (Fi+1,j , , , y y y y (Fi,j − Fi,j+1 ) Fi+1,j − Zi+1,j (Fi+1,j − Fi+1,j+1 )
= ki,j + max{0,
x x x − Fi,j ) −Fi+1,j+1 + hi Fi+1,j+1 + Zi,j+1 hi (Fi+1,j , , Fi+1,j+1 − Zi,j+1 − Zi+1,j + Zi,j (Fi,j − Zi,j ) x x hi (Fi+1,j+1 − Fi,j+1 ) , (Fi,j+1 − Zi,j+1 ) xy xy xy xy −hi (Fi,j − Fi+1,j + Fi+1,j+1 − Fi,j+1 ) }, ki,j > 0. y y y y (Fi,j − Fi,j+1 + Fi+1,j − Fi+1,j+1 )
(5. 10)
6. Applications A set of positive data is considered in Table 1. The data is generated from following function: F = ln(x2 + y 2 ) + 10. Figure 1 is produced by implementing the scheme developed in Theorem 4.1. From Table 1 y/x 0.01 100 200 300
0.01 1.4828 19.2103 20.5966 21.4076
100 19.2103 19.9035 20.8198 21.5129
200 20.5966 20.8198 21.2898 21.7753
300 21.4076 21.5129 21.7753 22.1007
the figure it is clear that the positive surface is generated through positive data of Table 1. Another set of positive data is considered in Table 2. These data is generated from the following function: F = 0.5(||x| − |y|| − |x| − |y|) + 3.1. Figure 2 is produced by implementing Theorem 4.1 on data set in Table 2. From the figure it is clear that a positivity is assured. The data set of Table 3 is of the plane: ³ x y´ . Z = 1− − 6 6
Visualization of Surface Data using Rational Bicubic Spline
97
25 20 15 10 5 0 300 250
300
200
250 150
200 150
100
100
50 0
50 0
Figure 1 Table 2 y/x -3 -2 -1 1 2 3
-3 0.1 1.1 2.1 2.1 1.1 0.1
-2 1.1 1.1 2.1 2.1 1.1 1.1
-1 2.1 2.1 2.1 2.1 2.1 2.1
1 2.1 2.1 2.1 2.1 2.1 2.1
2 1.1 1.1 2.1 2.1 1.1 1.1
3 0.1 1.1 2.1 2.1 1.1 0.1
2.5 2 1.5 1 0.5 0 4 4
2 2
0 0 −2
−2 −4
−4
Figure 2
Malik Zawwar Hussain and Maria Hussain
98
Table 3 y /x 1 2 3 4 5 6
1 0.6667 0.5000 0.3333 0.1667 -0.0000 -0.1667
2 0.5000 0.3333 0.1667 0.0000 -0.1667 -0.3333
3 0.3333 0.1667 0.0000 -0.1667 -0.3333 -0.5000
4 0.1667 0.0000 -0.1667 -0.3333 -0.5000 -0.6667
5 0.0000 -0.1667 -0.3333 -0.5000 -0.6667 -0.8333
6 -0.1667 -0.3333 -0.5000 -0.6667 -0.8333 -1.0000
Table 4 y/x 1 2 3 4 5 6
1 2 5 10 17 26 37
2 5 8 13 20 29 40
3 10 13 18 25 34 45
4 17 20 25 32 41 52
5 26 29 34 41 50 61
6 37 40 45 52 61 72
80 60 40 20 0 −20 6 6
4
5 4
2
3 0
2 1
Figure 3 The data set in Table 4 is generated from the following function: F = x2 + y 2 . The data set in Table 4 is lying above the plane: ³ x y´ . Z = 1− − 6 6 Figure 3 is generated using the scheme developed in Section 5. From the figure it is clear that surface lies above the plane. The data set in Table 5 is generated from the function F = sin(|x| + |y|) + 2.
Visualization of Surface Data using Rational Bicubic Spline
99
Table 5 y/x 1 2 3 4 5 6
1 2.9093 2.1411 1.2432 1.0411 1.7206 2.6570
2 2.1411 1.2432 1.0411 1.7206 2.6570 2.9894
3 1.2432 1.0411 1.7206 2.6570 2.9894 2.4121
4 1.0411 1.7206 2.6570 2.9894 2.4121 1.4560
5 1.7206 2.6570 2.9894 2.4121 1.4560 1.0000
6 2.6570 2.9894 2.4121 1.4560 1.0000 1.4634
3
2
1
0
−1 6
5
4
3
2
1
1
2
3
4
5
6
Figure 4 This data set is lying above the plane: ³ x y´ . Z = 1− − 6 6
Figure 4 is produced by using the scheme developed in Section 5. From the figure it is clear that surface lies above the plane. 7. Conclusion The paper is concerned with two major problems of scientific visualization, shape preservation and shape control. To achieve the goal, the method of variational design is adopted, i.e. introduction of free parameters in the description of rational bicubic function. Four free parameters αi,j , βi,j , α ˆ i,j and βˆi,j are introduced in the definition of a rational bicubic function. The free parameters are turned into the constrained parameters to preserve the shape of data. For shape control additional design elements (free parameters) are introduced in the definition of constrained parameters. Advantageous features of the methods are that they are applicable to both the cases when derivatives values are provided or estimated by some method. It works for equally as well as unequally spaced data. It is easy to implement as compared to previous methods. Same algorithm is applicable to every data. For
100
Malik Zawwar Hussain and Maria Hussain
example in the method of inserting knots we have to implement different knots for different data. References [1] Asim, M. R., Mustafa, G. and Brodlie, K., Constrained visualization of 2D positive data using modified quadratic Shepard method, WSCG Posters Proceedings, February 2-6, 2004, Plzen, Czech Republic, Union Agency-Science Press, (2004). [2] Brodlie, K. W. and Mashwama, P. and Butt, S., Visualization of surface data to preserve positivity and other simple constraints, Computers and Graphics, 19(4), (1995), 585-594. [3] Brodlie, K. W., Asim, M. R. and Unsworth, K., Constrained visualization using Shepard interpolation family, Computers and Graphics forum, 24(4), (2005), 809-820. [4] Chan, E. S. and Ong, B. H., Range restricted scattered data interpolation using convex combination of cubic Bzier triangles, Journal of Computational and Applied Mathematics, 136, (2001), 135-147. [5] Delbourgo, R. and Gregory, J. A., Shape preserving piecewise rational interpolation, SIAM J. Stat. Comput., 6, (1985), 967-976. [6] Floater, M. S., Total positivity and convexity preservation, J. Approx. Theory, 96, (1999), 46-66. [7] Gregory, J. A. and Sarfraz, M., A rational cubic spline with tension, Computer Aided Geometric Design , 7, (1990), 1-13. [8] Kong, V. P., Ong, B. H. and Saw, K. H., Range restricted interpolation using cubic Bzier triangles, WSCG, Feb 2-6, 2004, Plzen Czech Republic, Union Agency -Science Press, (2004). [9] Nadler, E., Non-negativity of bivariate quadratic functions on triangle, Computer Aided Geometric Design, 9, (1992), 195-205. [10] Piah, A. R. Mt., Goodman, T. N. T. and Unsworth, K., Positivity-preserving scattered data interpolation, Mathematics of Surfaces, (2005), 336-349. [11] Sarfraz, M., Interpolatory rational cubic spline with based point and interval tension, Computer and Graphics, 16(4), (1992), 427-430. [12] Sarfraz, M., Shape preserving rational interpolation, Extracta mathematicae, 28(2-3), (1993), 106-111. [13] Schmidt, J. W., Positivity, monotone and S-convex interpolation on rectangular grids, Computing, 48, (1992), 363-371. [14] Shepard, D., A two-dimensional interpolation function for irregularly spaced data, In Proceedings of the 23rd National Conference, New York, (1968), 517-523.