Data Visualization Using Rational Trigonometric SplineAcademic research paper on "Mathematics"

CC BY
0
0
Share paper
Journal of Applied Mathematics
OECD Field of science
Keywords
{""}

Academic research paper on topic "Data Visualization Using Rational Trigonometric Spline"

﻿Hindawi Publishing Corporation Journal of Applied Mathematics Volume 2013, Article ID 531497,10 pages http://dx.doi.org/10.1155/2013/531497

Research Article

Data Visualization Using Rational Trigonometric Spline

Uzma Bashir and Jamaludin Md. Ali

School of Mathematical Sciences, Universiti Sains Malaysia, 11800 Penang, Malaysia Correspondence should be addressed to Uzma Bashir; missheikh92@gmail.com Received 26 March 2013; Accepted 11 May 2013 Academic Editor: Francisco Chiclana

Copyright © 2013 U. Bashir and J. Md. Ali. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

This paper describes the use of trigonometric spline to visualize the given planar data. The goal of this work is to determine the smoothest possible curve that passes through its data points while simultaneously satisfying the shape preserving features of the data. Positive, monotone, and constrained curve interpolating schemes, by using a C1 piecewise rational cubic trigonometric spline with four shape parameters, are developed. Two of these shape parameters are constrained and the other two are set free to preserve the inherited shape features of the data as well as to control the shape of the curve. Numerical examples are given to illustrate the worth of the work.

1. Introduction

Data visualization, the technique of using images to represent information, has its history in the days back to the second century AD. But most of the developments are made in the last couple of centuries, predominantly during the last 30 years. It has extensively been used in industrial design, image processing, computer vision, computer aided geometric design, computer graphics, and many more. Shape preserving interpolation is a powerful tool to visualize the data in the form of curves and surfaces. The problem of curve interpolation to the given data has been studied with various requirements. One may be concerned with the smoothness of the interpolating curves, the preservation of the underlying shape features of the data, the computational complexity, or the fulfillment of certain constraints. Shape preserving signifies preserving the three basic and crucial geometrical features such as positivity, monotonicity, and convexity of the data. These shape characteristics can be easily observed when data arises from a physical experiment. In this case, it becomes vital that the interpolant produces curves more smooth and represent physical reality as close as possible. For this purpose, designers and engineers want such approximation methods that represent such physical situations accurately.

At present, spline methods have become the main tools forsolving themajorityofproblemsinvolving theapproxima-tion of functions, which also includes interpolation problems.

Many spline functions exist that generate smooth and visually pleasant curves. Sarfraz et al. [1] studied shape preserving curve interpolation for positive, monotone, convex data and data lying above a line, using a piecewise rational cubic function with four shape parameters. Hussain et al. [2] visualized scientific data with shape preserving C1 rational cubic interpolation by developing positive, monotone, and constrained data preserving schemes.

In recent years, polynomial splines and NURBS are replaced by trigonometric splines in order to prevail over the difficulties faced in using the former. Polynomial splines are not able to represent circular arcs and conics which are the most basic geometrical entity in almost every modeling system [3]. Also conics find a widespread application in optical and telecommunication instruments. NURBS offers great flexibility and precision for handling both analytic and freeform shapes but at the expense of intuitiveness and ease of implementation. A number of authors have contributed to trigonometric splines to represent curves and surfaces [411]. Lately, an alternative approach in shape preserving, using the trigonometric splines is introduced. Liu et al. [10] studied cubic trigonometric polynomial B-spline curves and surfaces with shape parameter. Ibraheem et al. [12] introduced a C1 piecewise rational trigonometric cubic function and piece-wise rational trigonometric bicubic function with four shape parameters to visualize the positivity of positive curve and

surface data. Zhu et al. [13] constructed shape preserving quartic trigonometric interpolation spline curves with shape parameters. The authors obtained F3 continuous shape preserving spline curves, for any shape parameters satisfying the shape preserving conditions.

In this paper, we present a C1 piecewise rational cubic trigonometric interpolating curve scheme for positive, monotone, and constrained data. Four positive shape parameters are used in the description of the interpolating scheme. Two of these parameters are constrained by simple data-dependent conditions to preserve the inherited shape feature of the data while the other two are kept free to modify the shape of the positive, monotone, and constrained curve. The scheme is useful for both equally and unequally spaced data.

This paper is arranged as follows. In Section 2, a C1 piece-wise rational cubic trigonometric spline with four shape parameters is constructed. Sections 3,4, and 5 describe positive, monotone, and constrained curve interpolation schemes, respectively, to visualize positive, monotone, and constrained 2D data. Section 5 concludes the paper with some future work.

2. C1 Piecewise Rational Cubic Trigonometric Spline

In this section, we develop a C1 piecewise rational cubic trigonometric spline with four parameters. Two of these parameters are free that can be used to preserve and control the shape of the interpolating curve while the other two are restricted. Data-dependent constraints are developed for these parameters to preserve the shape characteristics of the data under consideration.

Suppose that for knot spacing t0

< t„

given data points are defined as {(ti,fi): i = 0,1,2, ...,n} where ft are the function values at the knots of the function being interpolated. In each subinterval [ti,ti+1], i = 0,1, 2,... ,n - 1, a piecewise rational cubic trigonometric spline with four shape parameters is defined as

P(t) = Pt (t) =

№ ^bj

b0 = (1 - sin u) , bi =2 sin u(1 - sin u), b2 = 2 cos u(1 - cos u), b3 = (1 - cos u)2.

The spline in (1) is C1 continuous if the following interpolating conditions are satisfied:

P(t1) = f1, P(t1+1) = f1+1, P' (t,) = dt, P' (tM) = d,+i

where P'(t) denotes the derivative with respect to "t" and di are derivative values at given knots ti that are used for the shape control and smoothness of curve. These di are either given or can be computed by some numerical method [14].

Using conditions (3), the values of unknowns i = 0,1,2,3 are

<0 = fi, nw\fi + hÂ

n^f+i- hA+iw3i

13 = fi+1-

Thus after using (4), (1) takes the form

Pi (u)

P(t) = Pi (t) =

q,(u)'

0 n I nfM +hidiwQ0 'x-, p (u) = w0fib0 + ( Ji i i i ) bi

n^f+i- hA+iw3i

h2 + Wifi+ih,

q (u) = b0w0 + biwii + b2w2 + b3w3

u = (n/2)((t - ti)/hi), ht = ti+1 - ti, and w\, j = 0,1,2,3 are positive shape parameters. It is to mention that if the values of the shape parameters are chosen on trial basis, the shape characteristics of the data are not always preserved. Thus there arises a need for some conditions to be imposed on these shape parameters.

3. Positive Curve Interpolation

In this section, we utilize C1 piecewise rational cubic trigonometric spline developed in Section 1 to generate a positivity preserving curve using a positive data set.

Theorem 1. A C1 piecewise rational cubic trigonometric spline defined in (5) preserves the positivity of the positive data in each subinterval [ti,ti+1 ], i = 0,1,2,... ,n - 1, if the shape parameters satisfy the following conditions:

0 3 ^ n

wi ,w, > 0,

w, > max {

w, > max

-dj h,w°

d,+ihM "fi

Proof. Consider a data set {(tt, ft): i = 0,1,2,... ,n} such that

tt <ti+i, i = 0,1,2,...,n-1, ft > 0.

< ti < t2 < ■

Table 1: A 2D positive dataset.

Table 2: A 2D positive dataset.

i 1 2 3 4 5 6 7 8 i 1 2 3 4 5 6 7 8 9 10

ti 0 0.04 0.05 0.06 0.07 0.08 0.12 0.13 tt 0 3.25 15 26.5 30 32 37 40 42.5 44

fi 0.82 1.2 0.978 0.6 0.3 0.1 0.15 0.48 f 8.8 3 0.025 3.1 6.2 9.6 20 22.5 21.519 20

C1 piecewise rational cubic trigonometric spline given in (5) preserves positivity through positive data if Pi(t) > 0. Pi (t) >0 if

Pi (u),qt (u) > 0. (9)

Since qi(u) > 0, thus the positivity of the interpolant depends on pj(u) only.

pi(u) > 0 if all the coefficients are positive. It yields

, -dihiw0

2 di+1hiwj W; > -;-. (10)

™fi ' ' nfi + 1

Thus the sufficient conditions for the interpolant defined in (5) to preserve the positivity of positive data are that the shape parameters satisfy

o 3 ^ „

w, ,w, > 0,

w, > max {

w, > max

-d;h;w0

h ;u>3

This proves the desired result.

These conditions on the shape parameters can also be expressed as

w; = qi + max -

W: = vi + max -

-dihiw0

d-i+ihiwi

v; > 0.

The developed scheme is used to demonstrate the positivity preserving of positive data. The curves in Figures 1 and 3 are drawn by using C1 piecewise rational cubic trigonometric spline for 2D positive data sets given in Tables 1 and 2, respectively. Random values to the shape parameters are assigned and it is clearly visible that the resulting curves do not preserve the positivity. On the other hand, the positivity preserving curves in Figures 2 and 4 are generated for the same data set by using the scheme developed in Section 2. These figures also delineate the role of free shape parameters in shape control of the curve.

4. Monotone Curve Interpolation

A 2D data set {(ti,fi): i = 0,l,2,...,n} with tt < ti+1, i = 0,1,2,... ,n - 1 is said to be monotonically increasing (monotonically decreasing) if

fi < fi+1 (fi > fM).

1.4 1.2 1

0.8 0.6 0.4 0.2 0 -0.2

0 0.02 0.04 0.06 0.0 x-axis

0.1 0.12 0.14

Figure 1: Nonpositivity preserving rational cubic trigonometric curve.

This section discusses a monotonicity preserving curve interpolating scheme with four parameters. For a given set of monotone data points, we wish to generate a piecewise cubic trigonometric curve that interpolates the data points and preserves monotonicity as well. We drive data-dependent conditions for two shape parameters while leaving the other two for designer's choice.

Theorem 2. The C1 piecewise rational cubic trigonometric spline defined in (5) preserves the monotonicity through monotone data in each subinterval [ti, ti+1 ], i = 0,1,2,... ,n- 1 if the shape parameters satisfy the following conditions:

Wj ,wi > 0, ai < w] < ßi, Yi < w1 < ^

(x; = max -

o diW0

ßi = (1 +

3 d-i+M

Si = (1 + ^ U3.

w = 0.5

W = 0.5

w = 0.4

w, = 1

0 0.02 0.04

0.06 0.08 x-axis

0.1 0.12 0.14

0 0.02 0.04 0.06 0.( x-axis

0.1 0.12 0.14

Figure 2: A Cl positivity preserving curve with different values of free parameters.

wi = 0.5

W = 0.2

Wj = 0.3

w- = 0.5

0 5 10 15 20 25 30 35 40 45 x-axis

Figure 3: Nonpositive rational cubic trigonometric curve.

Proof. Let {(ti, fj): i = 0,1,2,... ,n} be a monotonically increasing data set, that is,

fi < fi+1 or equivalently A i = li+L-li > 0. (16)

The case of monotonically decreasing data set can be dealt in a similar fashion.

For monotonicity, the necessary conditions on derivatives

>0, i = 0,1,2,..., n.

There arise the following two cases for the interpolant (5) to preserve the monotonicity of monotone data.

Case 1. di = di+1 = 0 when A i = 0.In this case, Pi(t) reduces to

P, (t) = f„ Vte[t,,tM]. (18)

This proves that the interpolant is monotone.

Case 2. When A i = 0, then Pi(t) is monotonically increasing if and only if

P',(t)>0, yte[ti,tM]. (19)

For t e [ti, ti+1], Pl(t) is presented in a simpler form as

P't it)

2(% iu)f

x cos u(1 - sin u)2 + B2 cos U (1 + sin2«)

+ 2B3 cos u + B4 cos u sin u + 2B5 sin u

+B6 sin u (1 + cos2«) + B7 sin u(1 - cos u)2 + 4BS}

w0 = 1

W,. = 0.5

wi = 0.5

Wj = 1

0 5 10 15 20 25 30 35 40 45 x-axis

0 5 10 15 20 25 30 35 40 45 x-axis

w3 = 1.5

Figure 4: Positive curve by rational cubic trigonometric spline with different values of free parameters.

w = 0.5

w, = 1.3

w = 0.5

20 18 16 14 12 10 8 6 4

5 10 15 20 25 30 35 40 45 x-axis

Figure 5: Nonmonotonicity preserving curve.

2dt(W° )

B2 = 2A, (w1 - w°) (2w] - u>3)

^dj+M i i o\ 2djW0^ 2 3\

—-— (wi -wi)-—— (2wi -wi), tI n

n (a ( o 1\ diWi \ 3

B3 = (A i K -wt ) + —jwi, B4 = 2A; (w0 - 2wj) (2wf - w3)

f 2 3, 4di+iW3 f 0 1,

+ —r~ (2w>-w0 —^ (w> - 2w> )

+ A(A t (W2-W3)-(*L + ^

V V n n

>+M M 0

' W: I W:

+ 4A iwi wt,

n ( A i 3 2\ di+M\ 0

B5 = (A i (Wi ) + >

B6 = 2Ai (2wj - w0) (w2 - w3)

4diw0 t 2 3\ 2dj+iw\ f 1 o\

2dM(w3)

Bs = Ai - w1) (w2 - w3)

diw°i ( 2 3\ d+w3 / 0 1 \

+ —— (wt -wt )--— (wt -wt ).

w." = 0.7

W = 0.5

w, = 0.5

w.. = 0.8

20 25 x-axis

30 35 40 45

20 25 x-axis

Figure 6: Monotonicity preserving curve with different values of shape parameters.

90 80 70 60 50 40 30 20 10 0

w0 = 1

Figure 7: Nonmonotonicity preserving curve.

Table 3: A 2D monotone dataset.

i 1 2 3 4 5 6 7 8 9 10 11

ti 1 4 6.5 7 11 15 20 25 40 44 45

fi 1 1 2 3.5 5.5 5.5 10 10 12.5 18 20

Table 4: A 2D monotone dataset.

i 1 2 3 4 5 6 7 8 9 10 11

ti 0 2 3 5 6 8 9 11 12 14 15

fi 10 10 10 10 10 10 10.5 15 50 60 80

Also Bt >0, i = 2,3,4, 5,6, 8 if

i0 w, > w,,

i ^ diw\ W: >

i W 1 d, \ 0

W: < (1 + - I W: ,

The denominator of (20)isalwayspositive. Thusthe sufficient conditions for monotonicity preserving curve are

Bk >0, k=1,...,8,

since Bi,B7 > 0.

2 . 3 Wj > Wj ,

2 ^ dj+iw3

W: > - ,

w2 <{1 + ^+i ) w3,

W = 0.3

w, = 2

w- = 0.3

Wi = 2

x-axis

w,- = 0.5

w = 0.5

w, = 1

90 80 70 60

.52 50 ^ 40 30 20 10 0

90 80 70 60 .52 50 ^ 40 30 20 10 0

0 , = 3

Figure 8: Monotone data visualization with specified values of free parameters.

x-axis

x-axis

W = 0.3

Wj = 3

Hence, to preserve the monotonicity of monotone data and control the shape of the curve as per desire, (23) and (24) can be written as

0 3 ^ n w, ,w, > 0,

ai < w\ < ßf Y: < w! < si

ai = max -

0 0 , W: ,

0 d:w°

ft = |l + ^l»0.

„ 3 dMw3

0, W: , -

si = li + ^ iw:

as required.

To produce a monotone curve using a monotone data, the restrictions on the shape parameters can be rearranged as

0 3 ^ „ Wj ,wi > 0,

a. + k, = wj -I, k¡,li >0, (27)

Yi + mt = wf = Si - ni, mi, ni > 0.

To implement the developed scheme, two monotone data sets are given in Tables 3 and 4, respectively. Initially, the curves are generated by assigning arbitrary values to the

y = 0 06x + 0.02

0 0.5 1 1.5

W = 0.3

2 2.5 3 3.5 4 4.5 x-axis

w? = 0.4

..,3 _ n !Z

Figure 9: Rational cubic trigonometric curve lying below the given line.

four shape parameters and nonmonotonicity preserving curves are shown in Figures 5 and 7, respectively To remedy this deficiency, the scheme developed in Theorem 2 is applied to the same data sets and monotonicity preservation and smoothness of the curves are shown in Figures 6 and 8, respectively. □

W; = 0.5

< +0.0

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 x-axis

w0 = 1

y = ).06x + \ 0.02

0 0.5 1 1.5 2 2.5 3 3.5 4 x-axis

w0 = 0.5

. .3 AC

Figure 10: Cl rational cubic trigonometric curve lying above the given line with different values of free parameters.

w = 0.8

2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0

= 0.05x + 0.23

Table 5: 2D data set lying above the line y = 0.06x + 0.02.

0 0.5 1 1.5 2 2.5 3 3.5 4 x-axis

w0 = 1

i 1 2 3 4 5

ti 0 1.1 2 3 4.5

f 1.5 0.4 4 6.2 6

Table 6: 2D data set lying ab ove the line y = 0.05%+ 0.23.

i 1 2 3 4 5 6 7 8 9

tt 0 0.3 0.5 1 1.5 2 2.5 3.05 4

f 2 0.6 0.33 0.35 1 0.5 1.1 0.45 0.6

Theorem 3. The C1 piecewise rational cubic trigonometric spline defined in (5) preserves the shape of data lying above an arbitrary straight line in each subinterval [tj, ti+1 ], i = 0,1,2,... ,n - 1, if the following conditions are satisfied:

Figure 11: Rational cubic trigonometric curve lying below the given line.

5. Constrained Curve Interpolation

In this section, we generalize the curve scheme for positive data developed in Section 2. It is assumed that the data under consideration lies not only above the line y = 0, but also above any arbitrary line y = mx+c. We wish to drive a scheme for generating a curve which interpolates this data and lies above the line as well.

0 3 ^ n w, ,w, > 0,

w, > max {

w > max

-dj hwi

di+lhiw3i K(f,+1 -I)

Proof. Let {(tj, f) i = 0,1,2,... ,n} be a set of data points lying above a given straight line y = mx + c; that is,

f > mtj + c.

w = 0.5

w3 = 1

w = 0.5

0.8 0.6 0.4

y = 0.05x Z5 + 0.23

1.5 2 2.5 x-axis

2 1.8 1.6 1.4 is 1.2 ^ 1 0.8 0.6 0.4 0.2

y = 0.05 x + 0.23

1.5 2 2.5 x-axis

Figure 12: C piecewise rational cubic trigonometric curve constrained by a given line.

w = 0.2

w = 0.8

w = 0.2

W = 0.9

The curve will lie above the straight line if the rational cubic trigonometric spline (5) satisfies the following condition:

P(t)>mt + c, yte[t0, tn]. (30)

For each subinterval [t,, ii+1], (30) can be expressed as

P, (t) = p^>*, (l-2u)-2ul3, (31)

q{ (u) V n ) n

Pi (u) - lqt (u) > 0,

where I = a,(l - (2/n)u) - (2/n)ufr with a, = mt, + c and l, = mti+1 + c. Using the values of p,(u) and qt(u) as defined in (5), (31) can be written in a simplified form as

Using (4), we get

libJ -lwjbJ >0

j=0 j=0

IbjCj > 0

C0 = fi - lw°

->if, + h,d

iWi -lw],

C2 =nWif+ -hidMWi -lw2,

C4 = fi+1 - lw3

Since bj >0,j = 0,1,2,3, thus (34) is true if Cj > 0. As C0,C3 > 0: C1 >0 if

i -dihiW

Also C2 >0 if

2 di+ihiw3 w >

n(fi+i -1)'

Thus for a curve constrained by a line, the parameters must

satisfy

0 3 ^ „

Wj ,wi > 0,

w, > max {

w, > max

-d, hw0

ncFö di+ihiw3

n(f+i -I)

Equation (38) can also be expressed as w°, w3 > 0,

wi = fa + max

w, = ] + max -

di+ihiw3 n(fi+i -I)

•, ] > 0.

The usefulness of the developed scheme is shown by taking data sets lying above a given line. The data set in Table 5 lies above line y = 0.06x + 0.02, whereas the data set given in Table 6 lies above the line y = 0.05x + 0.23. Figures 9 and 11 are produced by taking the values of the shape parameters on trial and error basis. These figures depict that the curves do not lie above the respective given straight lines. To remove this drawback, curves in Figures 10 and 12 are generated by using the constrained curve scheme developed in the previous theorem. It is clearly shown that the curves not only lie above their same respective lines but also can be made as smooth as required. □

6. Conclusion and Future Plan

A C1 piecewise rational cubic trigonometric spline is discussed in this paper to address the problem of scientific data visualization. Four positive shape parameters are used in the description of positive, monotone, and constrained curve interpolation schemes. Two of these four shape parameters are constrained to preserve the shape of data and the other two are left free for the designer to alter the shape of curves in order to look like as he wants them to be. The presented scheme works well for both equally and unequally spaced data. It is tested for different data sets to show its usefulness in curve construction. In future this scheme will be extended to rational bicubic surface interpolation scheme to generate positive, monotone, and constrained surfaces.

[8] X. Han, "Quadratic trigonometric polynomial curves concerning local control," Applied Numerical Mathematics, vol. 56, no. 1, pp. 105-115, 2006.

[9] X. Han, "A class of general quartic spline curves with shape parameters," Computer Aided Geometric Design, vol. 28, no. 3, pp. 151-163, 2011.

[10] H. Liu, L. Li, D. Zhang, and H. Wang, "Cubic trigonometric polynomial B-spline curves and surfaces with shape parameter," Journal of Information and Computational Science, vol. 9, no. 4, pp. 989-996, 2012.

[11] M. Sheng and B. Su, "A class of Bezier-type curves and surfaces by trigonometric polynomials," Journal of Computational Information Systems, vol. 9, no. 1, pp. 89-96, 2013.

[12] F. Ibraheem, M. Hussain, M. Z. Hussain, and A. A. Bhatti, "Positive data visualization using trigonometric function," Journal of Applied Mathematics, vol. 2012, Article ID 247120,19 pages, 2012.

[13] Y. Zhu, X. Han, and J. Han, "Quartic trigonometric Bezier curves and shape preserving interpolation curves," Journal of Computational Information Systems, vol. 8, no. 2, pp. 905-914, 2012.

[14] M. Sarfraz, S. Butt, and M. Z. Hussain, "Visualization of shaped data by a rational cubic spline interpolation," Computers & Graphics, vol. 25, no. 5, pp. 833-845, 2001.

Acknowledgments

The authors are grateful to the anonymous referees for their valuable comments which improved this paper significantly. This work is supported by School of Mathematical Sciences, Universiti Sains Malaysia.

References

[1] M. Sarfraz, M. Z. Hussain, and M. Hussain, "Shape-preserving curve interpolation," International Journal of Computer Mathematics, vol. 89, no. 1, pp. 35-53, 2012.

[2] M. Z. Hussain, M. Sarfraz, and M. Hussain, "Scientific data visualization with shape preserving C rational cubic interpolation," European Journal of Pure and Applied Mathematics, vol. 3, no. 2, pp. 194-212, 2010.

[3] G. E. Farin, Curves and Surfaces for Computer-Aided Geometric Design: A Practical Code, Academic Press, Princeton, NJ, USA, 1996.

[4] X. Han, "Quadratic trigonometric polynomial curves with a shape parameter," Computer Aided Geometric Design, vol. 19, no. 7, pp. 503-512, 2002.

[5] X. Han, "Piecewise quadratic trigonometric polynomial curves," Mathematics of Computation, vol. 72, no. 243, pp. 1369-1377, 2003.

[6] X. Han, "Cubic trigonometric polynomial curves with a shape parameter," Computer Aided Geometric Design, vol. 21, no. 6, pp. 535-548, 2004.

[7] X. Han, "C2 quadratic trigonometric polynomial curves with local bias," Journal of Computational and Applied Mathematics, vol. 180, no. 1, pp. 161-172, 2005.

Copyright of Journal of Applied Mathematics is the property of Hindawi Publishing Corporation and its content may not be copied or emailed to multiple sites or posted to a listserv without the copyright holder's express written permission. However, users may print, download, or email articles for individual use.