100% found this document useful (4 votes)
51 views

Immediate Download Fundamentals of Graphics Using MATLAB 1st Edition Ranjan Parekh Ebooks 2024

Parekh

Uploaded by

tazazobaltan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
51 views

Immediate Download Fundamentals of Graphics Using MATLAB 1st Edition Ranjan Parekh Ebooks 2024

Parekh

Uploaded by

tazazobaltan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

Fundamentals of Graphics Using MATLAB 1st


Edition Ranjan Parekh

https://textbookfull.com/product/fundamentals-of-
graphics-using-matlab-1st-edition-ranjan-parekh/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Fundamentals of Computer Graphics Steve Marschner

https://textbookfull.com/product/fundamentals-of-computer-graphics-
steve-marschner/

textbookfull.com

Fundamentals of Technical Graphics Volume I Edward E


Osakue

https://textbookfull.com/product/fundamentals-of-technical-graphics-
volume-i-edward-e-osakue/

textbookfull.com

Programming Mathematics Using MATLAB 1st Edition Lisa A.


Oberbroeckling

https://textbookfull.com/product/programming-mathematics-using-
matlab-1st-edition-lisa-a-oberbroeckling/

textbookfull.com

Principles of Animal Research Ethics 1st Edition Tom L


Beauchamp David Degrazia

https://textbookfull.com/product/principles-of-animal-research-
ethics-1st-edition-tom-l-beauchamp-david-degrazia/

textbookfull.com
Russian English Visual Bilingual Dictionary 1st Edition Dk

https://textbookfull.com/product/russian-english-visual-bilingual-
dictionary-1st-edition-dk/

textbookfull.com

Gardner’s Art Through the Ages: A Global History, Volume I


Fred S. Kleiner

https://textbookfull.com/product/gardners-art-through-the-ages-a-
global-history-volume-i-fred-s-kleiner/

textbookfull.com

Protocols for High-Risk Pregnancies : An Evidence-Based


Approach John T. Queenan (Editor)

https://textbookfull.com/product/protocols-for-high-risk-pregnancies-
an-evidence-based-approach-john-t-queenan-editor/

textbookfull.com

The Startup Equation A Visual Guidebook to Building Your


Startup 1st Edition Steve Fisher

https://textbookfull.com/product/the-startup-equation-a-visual-
guidebook-to-building-your-startup-1st-edition-steve-fisher/

textbookfull.com

Programming Elm Build Safe and Maintainable Front End


Applications 1st Edition Jeremy Fairbank

https://textbookfull.com/product/programming-elm-build-safe-and-
maintainable-front-end-applications-1st-edition-jeremy-fairbank/

textbookfull.com
Government and Political Trust 1st Edition Duncan

https://textbookfull.com/product/government-and-political-trust-1st-
edition-duncan/

textbookfull.com
Fundamentals of Graphics
­Using MATLAB®
Fundamentals of Graphics
­Using MATLAB®

Ranjan Parekh
MATLAB ® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the
accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® software or related products
does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular
use of the MATLAB ® software

CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

© 2020 by Taylor & Francis Group, LLC


CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works

Printed on acid-free paper

International Standard Book Number-13: 978-0-367-18482-7 (Hardback)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the
validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the
­copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to
publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let
us know so we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or
utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, ­including
­photocopying, microfilming, and recording, or in any information storage or retrieval system, without written
­permission from the publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://
www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA
01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users.
For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been
arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com

and the CRC Press Web site at


http://www.crcpress.com
Contents

Preface, xi
Author, xv

Chapter 1   ◾   Interpolating Splines 1


1.1 INTRODUCTION 1
1.2 LINEAR SPLINE (STANDARD FORMS) 4
1.3 LINEAR SPLINE (PARAMETRIC FORM) 10
1.4 QUADRATIC SPLINE (STANDARD FORM) 13
1.5 QUADRATIC SPLINE (PARAMETRIC FORM) 15
1.6 CUBIC SPLINE (STANDARD FORM) 18
1.7 CUBIC SPLINE (PARAMETRIC FORM) 22
1.8 PIECEWISE SPLINES (STANDARD FORM) 25
1.9 PIECEWISE SPLINES (PARAMETRIC FORM) 31
1.10 CHAPTER SUMMARY 39
1.11 REVIEW QUESTIONS 39
1.12 PRACTICE PROBLEMS 40

Chapter 2   ◾   Blending Functions and Hybrid Splines 41


2.1 INTRODUCTION 41
2.2 BLENDING FUNCTIONS 41
2.3 BLENDING FUNCTIONS OF INTERPOLATING SPLINES 46
2.4 HERMITE SPLINE 52
2.5 CARDINAL SPLINE 57
2.6 CATMULL–ROM SPLINE 61
2.7 BEZIER SPLINE 63
2.8 SPLINE CONVERSIONS 69

v
vi   ◾    Contents

2.9 CHAPTER SUMMARY 74


2.10 REVIEW QUESTIONS 74
2.11 PRACTICE PROBLEMS 75

Chapter 3   ◾   Approximating Splines 77


3.1 INTRODUCTION 77
3.2 LINEAR UNIFORM B-SPLINE 78
3.3 CHANGING NUMBER OF CONTROL POINTS 88
3.4 QUADRATIC UNIFORM B-SPLINE 89
3.5 JUSTIFICATION FOR KNOT-VECTOR VALUES 102
3.6 QUADRATIC OPEN-UNIFORM B-SPLINE 105
3.7 QUADRATIC NON-UNIFORM B-SPLINE 108
3.8 CUBIC UNIFORM B-SPLINE 109
3.9 CHAPTER SUMMARY 131
3.10 REVIEW QUESTIONS 131
3.11 PRACTICE PROBLEMS 132

Chapter 4   ◾   2D Transformations 133


4.1 INTRODUCTION 133
4.2 HOMOGENEOUS COORDINATES 135
4.3 TRANSLATION 136
4.4 SCALING 138
4.5 ROTATION 140
4.6 FIXED-POINT SCALING 143
4.7 FIXED-POINT ROTATION 145
4.8 REFLECTION 147
4.9 FIXED-LINE REFLECTION 149
4.10 SHEAR 152
4.11 AFFINE TRANSFORMATIONS 155
4.12 PERSPECTIVE TRANSFORMATIONS 159
4.13 VIEWING TRANSFORMATIONS 163
4.14 COORDINATE SYSTEM TRANSFORMATIONS 167
4.15 CHAPTER SUMMARY 168
4.16 REVIEW QUESTIONS 169
4.17 PRACTICE PROBLEMS 169
Contents   ◾    vii

Chapter 5   ◾   Spline Properties 171


5.1 INTRODUCTION 171
5.2 CRITICAL POINTS 172
5.3 TANGENT AND NORMAL 176
5.4 LENGTH OF A CURVE 181
5.5 AREA UNDER A CURVE 183
5.6 CENTROID 189
5.7 INTERPOLATION AND CURVE FITTING 192
5.8 NOTES ON 2D PLOTTING FUNCTIONS 199
5.9 CHAPTER SUMMARY 205
5.10 REVIEW QUESTIONS 205
5.11 PRACTICE PROBLEMS 206

Chapter 6   ◾   Vectors 207


6.1 INTRODUCTION 207
6.2 UNIT VECTOR 208
6.3 DIRECTION COSINES 210
6.4 DOT PRODUCT 212
6.5 CROSS PRODUCT 214
6.6 VECTOR EQUATION OF A LINE 215
6.7 VECTOR EQUATION OF PLANE 218
6.8 VECTOR ALIGNMENT (2D) 222
6.9 VECTOR EQUATIONS IN HOMOGENEOUS COORDINATES (2D) 225
6.10 VECTOR EQUATIONS IN HOMOGENEOUS COORDINATES (3D) 229
6.11 NORMAL VECTOR AND TANGENT VECTOR 234
6.12 CHAPTER SUMMARY 239
6.13 REVIEW QUESTIONS 239
6.14 PRACTICE PROBLEMS 240

Chapter 7   ◾   3D Transformations 241


7.1 INTRODUCTION 241
7.2 TRANSLATION 241
7.3 SCALING 245
7.4 ROTATION 248
7.5 FIXED-POINT SCALING 251
viii   ◾    Contents

7.6 FIXED-POINT ROTATION 254


7.7 ROTATION PARALLEL TO PRIMARY AXES 256
7.8 VECTOR ALIGNMENT (3D) 264
7.9 ROTATION AROUND A VECTOR 270
7.10 ROTATION AROUND AN ARBITRARY LINE 273
7.11 REFLECTION 277
7.12 SHEAR 280
7.13 CHAPTER SUMMARY 283
7.14 REVIEW QUESTIONS 284
7.15 PRACTICE PROBLEMS 284

Chapter 8   ◾   Surfaces 287


8.1 INTRODUCTION 287
8.2 PARAMETRIC SURFACES 288
8.3 BEZIER SURFACES 293
8.4 IMPLICIT SURFACES 298
8.5 EXTRUDED SURFACES 307
8.6 SURFACES OF REVOLUTION 308
8.7 NORMAL VECTOR AND TANGENT PLANE 312
8.8 AREA AND VOLUME OF SURFACE OF REVOLUTION 317
8.9 TEXTURE MAPPING 320
8.10 SURFACE ILLUMINATION 329
8.11 NOTES ON 3D PLOTTING FUNCTIONS 335
8.12 CHAPTER SUMMARY 349
8.13 REVIEW QUESTIONS 350
8.14 PRACTICE PROBLEMS 350

Chapter 9   ◾   Projection 353


9.1 INTRODUCTION 353
9.2 2D PROJECTION 354
9.3 3D PROJECTION 361
9.4 MULTI-VIEW PROJECTION 366
9.5 AXONOMETRIC PROJECTION 369
9.6 FORESHORTENING FACTORS 371
9.7 ISOMETRIC, DIMETRIC, AND TRIMETRIC 375
9.8 OBLIQUE PROJECTION 382
Contents   ◾    ix

9.9 PERSPECTIVE PROJECTION 387


9.10 CHAPTER SUMMARY 391
9.11 REVIEW QUESTIONS 392
9.12 PRACTICE PROBLEMS 392

APPENDIX I: MATLAB® FUNCTION SUMMARY395

APPENDIX II: ANSWERS TO PRACTICE PROBLEMS399

REFERENCES407

INDEX409
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Preface

T his book introduces fundamental concepts and principles of 2D and 3D


graphics and is written for under- and postgraduate students studying graphics- and/
or multimedia-related subjects. Most of the books on graphics use C programming envi-
ronments to illustrate practical implementations. This book deviates from this common
practice and illustrates the use of MATLAB® for the purpose. MATLAB by MathWorks,
Inc. is a data analysis and visualization tool suitable for algorithmic development and sim-
ulation ­applications. One of the advantages of MATLAB is that it contains large libraries
of in-built functions which can be utilized to reduce program-development time as com-
pared to other contemporary programming environments. It is assumed that the student
has basic knowledge of MATLAB, especially various matrix operations and plotting func-
tions. The MATLAB codes have been provided as answers to specific examples, and the
reader can simply copy and paste the codes to execute them. In general, the codes display
answers to expected results like equation of curves, blending functions, and transforma-
tion matrices as well as plot the final results to provide a visual representation of the solu-
tion. The objectives of this book are, first, to demonstrate how MATLAB can be used to
solve problems in graphics and, second, to help the student gain an in-depth knowledge
about the subject matter through visual representations and practical examples.
This book is roughly divided into two parts: 2D graphics and 3D graphics, although in
some places both of these concepts overlap mainly to highlight the differences between
them or for using simpler concepts to prepare the reader for more complex ones.
The first part of this book mainly deals with concepts and problems related to 2D
­graphics, and spans over five chapters: (1) Interpolating Splines, (2) Blending Functions
and Hybrid Splines, (3) Approximating Splines, (4) 2D Transformations, and (5) Spline
Properties.
Chapter 1 provides an introduction regarding the various types of interpolating splines
and their representations using polynomials. The theoretical concepts about how spline
equations are derived and the matrix algebra involved are discussed in detail followed by
numerical examples and MATLAB codes to illustrate the processes. Most of the e­ xamples
are followed by graphical plots to enable the reader visualize how the equations get
­translated into corresponding curves given their start points, end points, and other related
parameters. The chapter also highlights the differences in these procedures for both stan-
dard or spatial form and parametric form of the spline equations using linear, quadratic,
and cubic variants.

xi
xii   ◾    Preface

Chapter 2 introduces the concept of blending functions and how these functions are
used to derive equations for hybrid splines which pass through only a subset of their control
points or where conditions other than control points are used for deriving their equations.
Specifically, the chapter deals with the Hermite spline, Cardinal spline, Catmull–Rom
spline, and Bezier spline. For Bezier splines, both the quadratic and cubic variants are dis-
cussed along with Bernstein polynomials used to formulate their blending functions. As
in other chapters, the theoretical concepts are followed by numerical examples, MATLAB
codes and graphical plots for visualization. The chapter ends with a discussion about how
one spline type can be converted to another.
Chapter 3 discusses how polynomial equations are derived for approximating splines
that do not pass through any of their control points and how their blending functions
are computed. Specifically, the chapter provides detailed discussions about the Cox de
Boor algorithm and how it can used to derive equations for linear, quadratic, and cubic
B-splines. Essentially, B-splines consist of multiple curve segments with continuity at join
points. Values of the parametric variable at the join points are stored in a vector called
the knot vector. If the knot values are equally spaced, then the resulting spline is called
uniform B-spline; otherwise, it is referred to as non-uniform. B-splines are called open-
uniform when knot vector values are repeated. The chapter provides representations of the
knot vector and illustrates how the spacing in the vector generates the above-­mentioned
variants. As before, the theoretical concepts are followed by numerical examples, MATLAB
codes, and graphical plots for visualization.
Chapter 4 formally introduces a 2D coordinate system and then lays the foundations of
a homogeneous coordinate system using which all the transformations can be represented
in a uniform manner. Two-dimensional transformations are used to change the location,
­orientation, and shapes of splines in 2D plane. These transformations are ­translation, ­rotation,
scaling, reflection, and shear applied individually or in combination of two or more; hence, they
are known as composite transformations. Given known coordinates of a point, each of these
transformations is represented by a matrix which when multiplied to the original coordinates
produces a new set of transformed coordinates. The transformation matrices are first derived,
and then their applications are illustrated using examples, MATLAB codes, and graphical
plots. Both affine and perspective transformation types are discussed. The chapter ends with a
discussion on viewing transformations used for mapping a window to a viewport, and coordi-
nate system ­transformation used for mapping between multiple coordinate systems.
Chapter 5 enumerates some of the common properties of splines and how these can be
calculated from spline equations. First, it discusses the critical points namely minimum
and maximum of spline curves. Additionally for splines of degree 3 or more, the point of
inflection (POI) is of interest. Next, it discusses how the tangent and normal to a spline
curve can be calculated. The tangent to a curve is the derivative of the curve equation,
while the normal is the line perpendicular to the tangent. The third property is calculation
of length of a spline curve between any two given points, both for spatial and parametric
equations. The fourth property is to calculate the area under a curve, which is bounded
by a primary axis and two horizontal or vertical lines. An extension to this is calculation
of area bounded by two curves. The fifth property is calculation of centroid of an area,
Preface   ◾    xiii

the point of the center of gravity for plates of uniform density. The chapter ends with a
discussion on interpolation and curve fitting for data points and a list of some commonly
used built-in MATLAB functions for plotting 2D graphs and plots.
The second part of this book focuses on concepts and problems related to 3D graphics
and spans over the remaining four chapters namely (6) Vectors, (7) 3D Transformations,
(8) Surfaces, and (9) Projections.
Chapter 6 introduces the concept of vectors and their mathematical representations in
2D and 3D spaces. Vectors involve both magnitude and direction. They are represented
in terms of orthogonal reference components of unit magnitudes along the primary axes
together with a set of scaling factors. The chapter discusses how vectors can be added and
multiplied together. Vector products can either be scalar, called a dot product, or vector,
called a cross product. Using these concepts, the chapter then provides details of how vec-
tor equations of lines and planes can be derived. Next, the chapter discusses how vectors
can be aligned to specific directions and finally how vector equations can be represented
using homogeneous coordinates. The chapter ends with a section on how the tangent ­vector
and the normal vector can be calculated for a curve. As before, the theoretical concepts are
followed by numerical examples, MATLAB codes, and graphical plots for visualization.
Chapter 7 demonstrates how 3D transformations can be treated as extensions of 2D
transformations. These are used to change the location, orientation, and shapes of splines
in 3D space. These transformations are translation, rotation, scaling, reflection, shear
applied individually or in combination of two or more, known as composite transforma-
tion. This chapter formally introduces a 3D coordinate system and then uses homogeneous
coordinates to derive transformation matrices for the above operations. Their applications
are then illustrated using examples, MATLAB codes and graphical plots for v­ isualization.
The latter part of the chapter deals with vector alignment in 3D space and uses these
­concepts to derive rotation matrices in 3D space around vectors and arbitrary lines.
Chapter 8 takes a look at how surfaces can be created and represented using parametric
and implicit equations, and how the nature of the surface depends on the parameters of
the equations. Depending on creation process, surfaces can be categorized as extruded
and surfaces of revolution, both of which are discussed with examples and graphical plots.
The chapter then takes a look at how tangent planes of surfaces can be computed and
­provides methods for computing area and volume of surfaces. The latter part of the ­chapter
deals with surface appearances namely how textures can be mapped on surfaces and how
­illumination models can be used to determine brightness intensities at a point on the
­surface. The chapter ends with a discussion on some commonly used built-in MATLAB
functions for plotting 3D graphs.
Chapter 9 studies various types of projections and derives matrices for each. Projection
is used to map a higher-dimensional object to a lower-dimensional view. Projection can be
of two types: parallel and perspective. In parallel projection, projection lines are ­parallel to
each other, while in perspective projection, projection lines appear to converge to a r­ eference
point. Parallel projection can again be of two types: orthographic and oblique. In parallel
orthographic projection, the projection lines are perpendicular to the view plane, while
in parallel oblique projection, the projection lines can be oriented at any arbitrary angle
xiv   ◾    Preface

to the view plane. Usually for 3D projection, parallel orthographic projection can also be
sub-divided into two types: multi-view and axonometric. In multi-view projection, the
projection occurs on the primary planes i.e. XY-, YZ-, or XZ-planes, while in axonometric
projection, the projection occurs on any arbitrary plane. The chapter illustrates each type
of projection using examples, MATLAB codes, and graphical plots for visualization.
Each chapter is followed by a summarized list of salient points discussed in the chapter.
A set of review questions and a list of practice problems are provided at the end of each
chapter for self-evaluation. This book contains more than 90 solved numerical examples
with their corresponding MATLAB codes and an additional 90 problems given for prac-
tice. Readers are encouraged to execute the codes given in the examples and also write
their own codes to solve the practice problems. Most of the MATLAB codes given in this
book will require MATLAB version 2015 or later to execute properly. Some of the func-
tions mentioned have been specifically introduced from version 2016 and these have been
mentioned at the appropriate places. The usage of about 70 different MATLAB functions
related to graphics and plotting have been demonstrated in this book and a list of these
functions with a short description is provided at Appendix I. Readers are asked to use
MATLAB help utilities to get further information on these. The MATLAB codes are writ-
ten in a verbose manner for a better understanding of the readers who are new to the
subject matter. Some of the codes could have been written in a more compact manner but
that might have reduced their comprehensibility. Around 170 figures have been included in
this book to help the readers get proper visualization cues of the problems especially for 3D
environments. Answers to the practice problems are provided in Appendix II.
All ­readers are encouraged to provide feedback about the content matter of the book as
well as any omissions or typing errors. The author can be contacted at ranjan_parekh@
yahoo.com.

Ranjan Parekh
Jadavpur University
Calcutta 700032, India
2019

MATLAB® is a registered trademark of The MathWorks, Inc. For product information,


please contact:

The MathWorks, Inc.


3 Apple Hill Drive
Natick, MA 01760-2098 USA
Tel: 508-647-7000
Fax: 508-647-7001
E-mail: [email protected]
Web: www.mathworks.com
Author

Dr. Ranjan Parekh, PhD (Engineering), is Professor at the School of Education
Technology, Jadavpur University, Calcutta, India, and is involved with teaching subjects
related to Graphics and Multimedia at the post graduate level. His research interests
include ­multimedia ­information processing, pattern recognition, and computer vision.
He is also the author of Principles of Multimedia (McGraw Hill, 2012; http://www.mhhe.
com/parekh/multimedia2).

xv
Chapter 1

Interpolating Splines

1.1 INTRODUCTION
Splines are irregular curve segments with known mathematical properties. Splines are fre-
quently encountered in vector graphics when graphic objects are required to have a defined
shape in 2D planes (Figure 1.1a) or 3D space (Figure 1.1b) or moved along a specified path
(Figure 1.1c). Based on the coordinates of some of the points on the curves, or slopes of
lines along the curves, the graphics system needs to calculate a mathematical representa-
tion of the curve before storing them onto a disk. This representation usually takes the
form of “vectors” or a series of values stored in matrices. The values are calculated using
an orthogonal 2D coordinate system consisting of the origin, X-axis, and Y-axis. These
coordinate axes are often called the primary or principal axes.
The term “spline” has been derived from the ship building industry where it is used to
refer to wooden planks bent between wooden posts for building the curved hull of ships
(O’Rourke, 2003). The location of the fixed posts controlled the shape of the plank. In
graphics, we use specific points along the spline curve to control the shape of the spline
and hence they are aptly referred to as “control points,” shortened as CPs. Depending on
the relationship between the CPs and the actual curves, the splines can be broadly cat-
egorized into three types: (1) interpolating splines, where the spline actually goes through
the CPs; (2) approximating splines, where the spline goes near the CPs but not actually
through them; and (3) hybrid splines, where the spline goes through some of the CPs but
not through all (Hearn and Baker, 1996) (see Figure 1.2).
Splines are mathematically modeled using polynomials. Polynomials are expressions
constructed from variables and constants, and involve addition, subtraction, ­multiplication,
and non-negative integer exponents. A polynomial can be 0 (zero) or a sum of non-zero
terms. Each term consists of a constant, called coefficient, multiplied by a variable. The
exponent of the variable is called its degree. The first example is a valid polynomial, but
the second example is not, because the variable is associated with a division operation and
also because of the fractional exponent. The general nth degree polynomial is shown in the
third example.

1
2   ◾    Fundamentals of Graphics Using MATLAB®

(a)

(b)

10

0
z

-5

-10

10 10
5 5
0 0
-5 -5
y -10
-10 x
(c)

FIGURE 1.1 Use of splines in graphics for creating (a) 2D shapes (b) 3D surfaces (c) motion path
trajectory
Interpolating Splines   ◾    3

Interpolating Approximating Hybrid


5 10 4
3
0 5 2
-5 1
0
-10 0
-1
-15 -5
-2
-20 -10 -3
2 4 6 8 10 -2 0 2 4 0 2 4 6

FIGURE 1.2 Types of splines.

1 − 2 x + 3x 2

2
1− + 3x 2.5
x

an x n + an −1x n −1 +  + a1x + a0

A polynomial equation is written when one polynomial is set equal to another. It can
either be in explicit form e.g. y = f (x ) when either side of the equation contains variables of
explicit type, or it can be in implicit form e.g. f ( x , y ) = 0 where multiple types of variables
can be on the same side. Examples are shown below:

y = x2

x 3 + y 3 − 5 xy = 0

Polynomial equations can also be represented in parametric form where the variables are
expressed as functions of another variable t e.g. x = f (t ), y = g (t ). The advantage of para-
metric equations is that the variables x and y do not need to be constrained by a single
equation and can be changed independently of each other, which offers more flexibility for
representing complex curves. As a convention, the value of t is usually taken to lie between
0 and 1 unless otherwise specified. The value of t = 0 corresponds to the start point and
t = 1 to the end point of the spline curve. Examples are shown below:

x = t, y = t2

x = r ⋅ cos t , y = r ⋅ sin t

A polynomial equation is frequently represented using graphs, which are useful in ­visually
depicting how one variable changes with another. The graph of a zero polynomial i.e. f ( x ) = 0
is the X-axis. The graph of a zero degree polynomial represented by f ( x ) = a, where a is a
constant, is a line parallel to the X-axis at a distance a from it. The graph of a degree 1 polyno-
mial, represented by f ( x ) = a + bx, is a straight line with a slope b and intercept a. The graph
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
4   ◾    Fundamentals of Graphics Using MATLAB®

f(x) = 0 f(x) = a f(x) = a + bx


5 5 5

0 0 0

-5 -5 -5
-5 0 5 -5 0 5 -5 0 5

f(x) = a + bx + cx2 f(x) = a + bx + cx2 + dx3 f(x,y) = x3 + y3 - 5*x*y = 0


5 5 10

0 0 0

y
-5 -5 -10
-5 0 5 -5 0 5 -10 -5 0 5 10
x

x = cos(t) x = sin(t) x = sin(t), y = cos(t)


1 1 1

0 0 0

-1 -1 -1
-4 -2 0 2 4 -4 -2 0 2 4 -1 -0.5 0 0.5 1

FIGURE 1.3 Graphs of polynomial equations.

of a degree 2 polynomial, represented by f ( x ) = a + bx + cx 2, is a parabolic curve and can be


specified if at least three points are known on the curve. The graph of a degree 3 polynomial,
represented by f ( x ) = a + bx + cx 2 + dx 3, is a cubic curve and can be specified if at least four
points are known on the curve. Instead of explicit equations, implicit equations f ( x , y ) = 0
can also be plotted by varying the independent variable by fixed intervals and computing
the corresponding values of the dependent variables. Plots of parametric equations consist of
three different graphs: the first is the t vs. x graph generated from the function x = f (t ), the
second is the t vs. y graph generated from the function y = g (t ), while the third graph is x vs. y
generated by plotting the x and y values from the same values of t obtained from the previous
plots. Thus, even if we always do not generate an equation between x and y by eliminating t,
we can always plot a graph of x vs. y. Figure 1.3 shows graphs of various polynomial equations.
In the following sections, we take a look at few types of interpolating splines and how
their equations are derived.

1.2 LINEAR SPLINE (STANDARD FORMS)


A linear spline is a straight line represented by a first-degree polynomial and can be gen-
erated given two points are known along it. Standard form of a linear spline implies the
spline equation is computed in the spatial domain i.e. the x-y plane. Let the given points
be P1(x1, y1) and P2(x2, y2). Choose a starting linear equation that is written in matrix form

 a 
y = a + bx =  1 x    (1.1)
 b 
Substitute the given points in the starting equation to generate two equations. Two equa-
tions are sufficient to solve for the two unknown coefficients a and b
Interpolating Splines   ◾    5

y1 = a + bx1
(1.2)
y 2 = a + bx 2

The two equations are written in matrix form Y = C·A, where C is the constraint matrix and
A is the coefficient matrix:

 y1   1 x1  a 
 =   (1.3)
 y 2   1 x2   b 

The equations are solved to find the values of the unknown coefficients. Thus, we have
A = inv(C)·Y

−1
 a   1 x1   y1 
 b = 1    (1.4)
   x2   y 2 

The values of the coefficients are substituted in the starting equation to arrive at the
­equation of the spline.

−1
 1 x1   y1 
y =  1 x      (1.5)
 1 x 2   y 2 

Example 1.1
Find the equation of a line through points P1(3, 2) and P2(8, −4).
Choose a starting equation

 a 
y = a + bx =  1 x   
 b 

Substitute given points in the equation

2 = a + b(3)

−4 = a + b(8)

Write in matrix form Y = C·A

 2   1 3  a 
 −4  =  1 8   b 
  
6   ◾    Fundamentals of Graphics Using MATLAB®

P1
2

-1
y

-2

-3

-4
P2

-5
0 2 4 6 8 10
x

FIGURE 1.4 Plot for Example 1.1.

Solve the matrix equation A = C−1·Y

 a   1.6 −0.6   2   5.6 


 b  =  −0.2 =
0.2   −4   −1.2 
  

Substitute the coefficient values in the starting equation

y = 5.6 − 1.2 x

Verification: In most graphics problems, it is usually possible to verify the results


obtained by substituting the given data in it. Putting x = 3, we get y = 2, and p
­ utting
x = 8, we get y = −4. Hence, the line does indeed pass through the given points
(Figure 1.4).

MATLAB® Code 1.1


clear all; clc;
syms x;
x1 = 3; y1 = 2;
x2 = 8; y2 = -4;
X = [x1 x2]; Y = [y1 y2];
C = [1 x1; 1 x2];
A = inv(C)*Y';
a = A(1);
Interpolating Splines   ◾    7

b = A(2);
fprintf('Required equation : \n');
y = a + b*x;
y = vpa(y)

%plotting
xx = linspace(x1, x2);
yy = subs(y, x, xx);
plot(xx, yy, 'b-'); hold on;
scatter(X, Y, 20, 'r', 'filled');
xlabel('x'); ylabel('y');
grid; axis square;
axis([0 10 -5 3]);
d = 0.5;
text(x1+d, y1, 'P_1');
text(x2+d, y2, 'P_2');
hold off;

NOTE
%: signifies a comment line
axis: controls appearance of the axes of the plot, specifies ordered range of values to display
clc: clears workspace of previous text
clear: clears memory of all stored variables
fprintf: prints out strings and values using formatting options
grid: turns on display of grid lines in a plot
hold: holds the current graph state so that subsequent commands can add to the same graph
inv: computes inverse of a matrix
linspace: creates 100 linearly spaced values between the two end-points specified
plot: creates a graphical plot from a set of values
scatter: type of plot where the data is represented by colored circles
subs: substitutes symbolic variable with a matrix of values for generating a plot
syms: declares the arguments following as symbolic variables
text: inserts textual strings at specified locations in the graph
title: displays a title on top of the graph
vpa: displays symbolic values as variable precision floating point values
xlabel, ylabel: puts text labels along the corresponding primary axes

An alternate form of the standard line equation can be formed where, instead of two
given points, only one point and the slope of the line are given. This aspect is discussed
below.
Let the given points be P1(x1, y1) and s be the slope of the line. Choose a starting linear
equation that is written in matrix form as before in Equation (1.1).

 a 
y = a + bx =  1 x   
 b 
8   ◾    Fundamentals of Graphics Using MATLAB®

Calculate derivative of the starting equation

dy
y′ = =b (1.6)
dx
Substitute the given values in the starting equation to generate two equations

y1 = a + bx1
(1.7)
s =b
The two equations are written in matrix form Y = C·A as before

 y1   1 x1   a 
 =   (1.8)
 s   0 1  b 

The equations are solved to find the values of the coefficients: A = C−1·Y

−1
 a   1 x1   y1 
 b =    (1.9)
   0 1   s 

The values of the coefficients are substituted in the starting equation to arrive at the
­equation of the spline.

−1
 1 x1   y1 
y =  1 x      (1.10)
 0 1   s 

Example 1.2
Find the equation of a line through the point P(−1, 1) and having slope 2.
Choose a starting equation

 a 
y = a + bx =  1 x   
 b 

Calculate derivative of the starting equation

dy
y′ = =b
dx

Substitute given values in the equation

1 = a + b(−1)

2=b
Random documents with unrelated
content Scribd suggests to you:
hopeless false-alarm. Contrary to previous statements, in matters of
breeding kind hearts can not compare with coronets, particularly
when the latter have been in the family for ten generations.
Finding himself a failure in the fields of sport, riding to or from the
hounds, cricket and the active exercises, intellectually unable to
compete in cultural pursuits such as the writing of memoirs or the
collecting of sea shells and butterflies, Wimpole was thrown back on
the last recourse of affluent ignorance, travel and dissipation.
In the latter field he showed a natural aptitude which, had it been
caught and cultivated in some previous generation, might have
made him a rather attractive rake. But it came too late; he was
merely beastly. Lady Wimpole was quite frank about it.
“Your husband,—is he with you?” I asked.
She raised her beautiful pinkish eye-lids toward the ceiling. “Still
asleep ... he was unusually crocked last night. You know he has
taken up the vices. He tries to be brutal.”
“Does he beat you?” I put the question frankly because I knew it
was the traditional thing and I felt that she would appreciate a direct
method.
“No,” she said simply. “He would like to but he doesn’t dare. He does
his worst however. He bites.”
She slipped back the soft sleeve of her gown and extended an arm. I
shrank back in horror. The dog! A semi-circle of teeth-marks marred
the salmon-silkiness of the loveliest fore-arm in the world.
Involuntarily I paled and yet felt curiously relieved. This proof of
dastardly conduct on her husband’s part seemed to make easier the
thing I knew I should eventually have to do, namely, take this
gorgeous creature from him.
Turning toward the parrot to hide my emotion I said “Madame,—I
am sorry to bring you bad news ... but we are both summoned to
appear before the local police magistrate the day after tomorrow.
The charge is murder. You are a material witness. The affair is
entirely technical, but there are unseen influences at work. The
young man,—the scoundrel who attempted to steal your gold, was
well-connected, of an old Peruvian family. They have cabled
representations to the Monacan government. The whole affair has
the look of a nasty, political embroglio. It may last some time. I was
once called as a witness to a trolley accident in Jerusalem and six
months afterward....”
“I will hear all that later. Today is Tuesday. Call for me Thursday
morning—what is the hour? eleven? Good—be here at ten-thirty: I
will not fail you. Adios.”
Again saluting her à la française, I departed.
For two days I carried her image in my heart. I know not how it is
with others but when I have once decided to love a certain person I
find it a simple matter to do so. At the first glimpse of Lady Wimpole
my heart, had, so to speak, assumed a crouching posture. It only
remained for me to tell my emotions what to do, just as I might
direct my great police dog, Graustein, to stop a suspicious character.
By now I was thoroughly aroused. The memory of those atrocious
teeth-marks and that blemished fore-arm were fresh fuel.
At exactly ten-thirty on the appointed Thursday I approached the
villa. It was close shuttered and wore a vacant, deserted look at
which my heart sank. The gate was locked and the bell jangled
noisily among deserted rose bushes.
“Curses!” I ground out between clenched teeth. “She was toying
with me!”
A step on the gravel interrupted my bitter reflections. It was the old
gardener.
“Madame est partie,” he announced, “et Monsieur aussi ... sur le
yacht ... ce matin.”
A glance toward the bay confirmed his statement; the slim white
shape of Wimpole’s yacht, the Undine, was no longer in sight.
“But did they leave no message?” I demanded.
He turned aside smiling.
“Un mot? Sais pas ... c’est-à-dire ... peut-être ...”
I saw what he was driving at. Damn the baksheesh hunting tribes!
“Here,” I said, thrusting a crisp bank-note through the bars. Seizing
it he fumbled in his blouse and produced a large envelope which I
clutched eagerly, tearing it open as the bearer disappeared into the
depths of the garden. Beneath the now familiar crest, in a bold
masculine handwriting, I read the simple words, “Meet me in the
desert, S. W.”
This thwarting of my desire, this baffling of my purpose—was the
one thing needed to set my blood on fire. On the instant I turned
and ran down the hill toward the water-side, all thought of Monacan
courts-of-law completely forgotten. At the precise moment when the
stately judge-advocate in his purple and green laetitia or official robe
opened the Monacan Court, the little Kawa was slipping over the
Southern horizon toward the African mountain wall beyond which lie
the limitless sands of the Sahara.
“Meet me in the desert,” she had said. No desert on earth could be
big enough to hide her. My emotions were up, and in full cry!
Chapter III
Into the Great Unknown
Chapter III
Africa! Far away I sighted the purple shadow of the land of mystery,
the low-lying coast-line and interior wall of mountains behind which
lay the vastness of Sahara.
We struck the coast at Djidjelli, further East than we had anticipated.
Captain Triplett, my navigator, said that compasses always acted
queerly in these waters which he ascribed to the influence of occult
desert powers, outraged divinities and the like.
“It’s them genuses,” he said, “they raise hell with yer.”
Be that as it may we had to veer sharply in order to make Algiers on
the third day after clearing from and out of Monte Carlo. The harbor
showed no trace of the Undine and according to the port-authorities
she had not touched there, nor was there any record of the Wimpole
party at the leading hotels or travel bureaus. They were gone,
swallowed up in the immense folds of the silent, brooding Southland.
“Meet me in the desert!” Lady Sarah’s parting cry rang in my ears. In
it I detected the first note of appeal suggesting her growing need of
me, a need of which she was perhaps still unconscious, but which
might grow to who knows what. Why was I so certain she referred
to Sahara, the Great Desert? I can not say, but it seemed inevitable
that she would choose the largest; it was in keeping with the
majestic, monumental nature of the woman. Whatever the reason I
was positive that somewhere in those uncharted wastes I should
find her. Facing them, as I stood on the quarter-deck with Whinney,
my acting-first-officer, I pressed Lady Wimpole’s letter in my breast
pocket and whispered softly “I come, my lady of the desert, I come.”
“How?” said Whinney.
“Nothing.” I answered shortly and went below.
Another certainty, arrived at during my trans-Mediterranean trip,
loomed large in my plans. Re-visiting the desert after an absence of
ten years I decided that I should assume my title of Sheik of the
Moplah Bedouins which had been conferred upon me in recognition
of having saved a native caravan from certain death due to the
sudden failure of the wells at the Oasis of Sus.
Since that memorable time the Sheik, as an institution, has acquired
a tremendous sentimental and romantic value which fell in admirably
with my quest of the remarkable English woman who had yanked
me so forcibly from the spiritual doldrums.
Tunis, Algiers, Fez and Agadir, all the important North African towns
—now do a thriving business in Sheik-outfitting, the bazaars ringing
with the cries of costumers, burnous-boys, veiled Circassian beauties
with their trays of turbans, dealers in arms and accoutrement,
saddle-sellers and camel merchants. But I needed none of this
shoddy material designed entirely for the tourist trade. What I
wanted was the real thing.
Two days after my arrival in Algiers I stumbled on Ab-Domen Allah,
the faithful dragoman who had dragged me through Turkey and
Arabia in 1902. It was sheer Traprock luck, for he was the very man
I wanted, capable, resourceful and devoted.
Over a glass of coffee on the terrace of the Di Baccho I explained
my needs.
“Si, si,” he hissed, patting his huge bulk delightedly. “I understand. I
will attend to everything. See, we had best do thus and so.”
Dipping his fore-finger in the coffee he drew an excellent likeness of
Africa on the tablecloth.
“We will enter here at Rascora on the very western edge of the
desert. You can go round by water: I will meet you there with the
camels. Thus we will go through the desert the long way. You will
miss nothing. You are looking for something, eh?”
I hesitated, but he burst out laughing.
“A woman! Aha, my friend. You have not changed since I met you in
Skutari! You devil!”
Drawing back from the table in order to give himself room to shake
he trembled like a mountain of jelly until a glance at his wrist-watch
told him it was the evening hour for worship. He could not kneel but
turned his chair toward Mecca and performed the orthodox
calisthenics in a sketchy but satisfactory manner.
Personally I was more than willing to let him have his laugh in
exchange for having secured his services. Matters of detail could
now be dismissed. At dawn the next day I weighed anchor for
Tangier and points west, slipping rapidly down the Moroccan coast
with short stops at Mogador, Rio de Oro and, finally, Rascora.
Rapid though the trip was it took the better part of a fortnight
allowing Ab-Domen no more than time to assemble our caravan.
During the interval I took up the re-study of the desert languages,
Berber, Arabic, Bedouin and the main Sudanese dialects all of which
I had fairly well mastered before we rounded the gleaming cliffs of
Cape Blanco. I also gave considerable time to exercising myself in
the florid style of speech without which no Sheik is really a Sheik.
During these periods of study I would stand near the capstan and
apostrophize my lost lady in the most poetic terms.
“O thou! beautiful as the dawn and rounded as the bursting lotus-
bud whose voice is as the cooing of a dove calling gently to its mate,
lo, from afar I come to thee.”
These proceedings astonished the crew. In fact I overheard Captain
Triplett say to Whinney, “The old man is cuckoo,” to which the
flippant first-officer replied, “You gushed a geyser.” I had to
reprimand them both severely.
Another exercise to which I devoted considerable time was the
practising of that stern, aloof mien which is the proper Sheik-ish
attitude. This was very hard for me for my nature is genial. However
no one ever heard of anyone clapping one of these portentous Arabs
on the shoulder with a “Hello, Sheik; how’s tricks.” That sort of thing
would mean death according to modern literary standards and I
endeavored to convey this idea to my companions whenever they
were familiar which was always. I almost precipitated a row when I
said one day to Whinney, “Peace, thou ill-begotten son of a base-
born mule-driver.”... He seized a belaying pin with the light of
mayhem in his eyes and I had great difficulty in explaining the
purely figurative meaning of my words.
In private, however, I continued the practise of speeches redolent of
the great eastern orators who are pastmasters of the art of saying it
with flowers, while I also steeled my heart to a cruelty toward all
woman-kind which is an absolute prerequisite of successful Sheik-
ery. Often, in the privacy of my cabin, I would seize my rolled-up
steamer rug by the throat and cry harshly “So, I have you at last,
have I? Remember, woman, you are mine! ... all mine.”
As may be imagined these studies filled in the time admirably and
made me mad with longing for the actual desert voyage to begin.
Two days after dropping anchor Ab-Domen appeared on the
outskirts of Rascora winding his way down from the Atlean foot-hills,
bells tinkling, flutes playing and camels smelling. He had assembled
a complete outfit equipped with everything for an indefinite stay in
the desert.
I had decided on camels as our motive power for I loathe such
modern contraptions as motorboats in Venice and motor-trucks in
the desert. I couldn’t quite fancy myself as a Sheik arriving on a
truck and crying “Lo! it is I, the son of the Eagle.” Besides I would
probably get my burnous caught in the fly-wheel which would be a
pity as it was really magnificent, a true Moplah Sheik costume, pure
white with a number of tricky gold ornaments.
Ab-Domen had done a gorgeous job in selecting my camels. During
his shopping he had been accompanied by my friend Herman
Swank, for many years my super-cargo. We stood together as the
herd wound its way into the village under its own power and Swank
gave me some interesting information on their fine points.
Qualifications to be considered in buying a camel are water-and-
weight capacity, hair-crop and stupidity. The first consideration is
how many miles per gallon can the beast do. Curiously, just as with
automobiles, dealers invariably lie about this point.
Weight-capacity is tested by loading the camel until he can’t get up
and then removing small amounts until he just can, thus giving the
traffic all that it can possibly bear.
The hair-crop of the camel is one of the staple harvests of the desert
area and is of tremendous value for the local manufacture of ropes,
shawls, blankets, etc., and for the export trade in camels-hair
brushes, used the world over by water-color artists. Water colors
are, of course, out of the question in the Sahara where there is very
little color and almost no water.
Stupidity, the last named attribute, is an essential in a good camel.
Fortunately most of them possess it to an amazing degree. Without
it no animal would think of entering the desert let alone carrying the
crushing burdens which are imposed upon them. Ab-Domen had
combed the country for stupid camels, among which the bactrian
booby-prize went to DeLong, my own mount. Whinney bestrode
Rufus, a reddish beast while Swank called his Clotilde in memory of
a young woman he had known in the Latin Quarter. They were all
single humped Arabians which are superior to the Asiatic variety, just
why I can’t say. After having ridden them a week it seemed
impossible that they could be superior to anything.
We left Triplett at Rascora whence he was to take the Kawa round to
Cairo. I allowed six months for our trans-African trek. Two days after
his departure we faced the East in the conventional caravan
formation, led by an ass, the emblem of good luck. Our number had
been increased by approximately sixty nomads of my own tribe, the
Moplahs, a number of minor-Sheiks and a rabble of desert folk,
Walatu-s, Gogo-s and Humda-s. To these must be added the doolahs
or black camel-boys who closed the file while Ab-Domen, on a
powerful camel, held a roving commission, darting hither and yon, or
to and fro as needed.
Our first objective was the Oasis of Arag-Wan. For several days we
passed through tiny desert villages, Uskeft, Shinghit, Tejigia and
others. There was no trace of the Wimpoles, but in this I was not
disappointed. It would have been humiliating to find her too quickly,
to stumble upon my lady on the first day out, to say “Oh, there you
are!” and to have the whole episode over. I felt sure that our
meeting would be more dramatic.

AB-DOMEN ALLAH
Dr. Traprock’s faithful Dragoman who, as the author says,
“literally dragged” him through the desert.

Ab-Domen Allah
On the fourth day we faced the empty desert. Never had I felt more
completely a Sheik. My friends Swank and Whinney had caught my
enthusiasm as well as my mode of dress and address.
“Hail, El-Swanko!” I would say; “Son of the well-known morn and
illustrious evening-star, may thy blessings be as the hairs on thy
camel’s head and thy bed as soft as his padded hoof.”
“Back at you, Dhubel-dhub, Sheik of the Moplah Chapter,” my friend
would cry, being a bit unpracticed in the fine points of sheik-talk. But
he came on rapidly and was soon able to converse fluently in the
ornate hyperbole of the country.
The desert and the ocean have been frequently compared but
happenings of the next few days were to bring this comparison
home in no uncertain terms. Swank and Whinney suffered acutely
from their first experience on camel-back and even I felt somewhat
uneasy until I became accustomed to DeLong’s pitch and roll. The
“ship-of-the-desert” is no idle poeticism.
Beyond Tejigia we were completely out of sight of water. No trace of
passing craft broke the horizon about us. Like an admiral at the head
of his fleet I scanned the sky anxiously. Three days passed. On the
fourth a violent head wind forced us to tack in order to keep the
sand out of our eyes.
The next morning I rose to face a titanic struggle between earth and
sky. The desert was rising. After a three-mile advance I gave the
order to heave-to. The camels were anchored fore-and-aft, to long
tent-pegs. The sand became increasingly fluid. Low ripples running
over its face rapidly rose to waves which dashed their stinging spray
over us with the rasping hiss of a devil’s hot breath. In the lulls I
could hear the wails of the doolahs and the bubbling roar of the
camels.
Ab-Domen fought with the resource and bravery of a great
commander. We were now all crouching low against the blast.
Suddenly I saw Ab-Domen point excitedly toward the East. A
gigantic tidal-wave of sand was bearing down upon us through the
murk. Of what followed I can only give a dim impression. I heard the
parting of several anchor ropes and the screams of the anguished
beasts as they and their riders were swept into oblivion. Then, as if
to administer the coup-de-grace, two enormous sand-spouts loomed
up from the south, hideous spinning wraiths, whirling dervishes of
the desert, personifying all the diabolic malevolence of this ghastly
land. One missed us, passing within a few yards of DeLong and
myself; the other moved directly across the compact mass of
doolahs who lay screaming in its path. I had a glimpse of a score of
black bodies sucked upward into the swirling column, spinning
helplessly in the vortex with arms and legs out-thrust, grasping or
kicking at the empty air. Then all was dark.

Five hours later I dug myself out of suffocation and sand. The storm
had passed. Twelve doolahs and two camels were missing. The rest
were badly disorganized. But the desert lay, calm and peaceful about
us. We had weathered the storm and, to my infinite joy, there, in the
distance, the white walls and bending palms of an oasis gleamed in
the evening sunlight—the wells of Arag-Wan. We had won through!
Chapter IV
The Wandering Wimpoles
Chapter IV
Still no trace of the Wimpoles. I was up early and out betimes. We
had pitched our tents and rested our caravan in the shadow of the
palms of Arag-Wan. Here our water-skins, canteens, camels and
other containers were filled to overflowing. A trace of French thrift
surprised me. The wells had been fenced off and equipped with a
red Bowser-pump guarded by a half-cast Berber in brown cloak and
battered visor-cap bearing the legend “Colonies d’Afrique.” There
was free-air but not free-water.
“Combien de gallons?” asked the old chap.
“Fill ’em up,” I ordered, knowing that the next station was hundreds
of miles to the eastward.

AT THE OASIS OF ARAG-WAN


Herman Swank, Traprock’s intrepid follower, superintending
the
important process of filling the camels.
At the Oasis of Arag-Wan

During the filling process I wandered out into the desert. The air
was cool and delicious. A soft breeze whispered through the palm
trees in the branches of which chattered a lavender tabit or doctor-
bird. Beyond the edge of oasis the low-growing palmettos, oleanders
and gun-sandarachs dwindled to stunted prickly pears and leprous
leaved squill-vines among which I noted the fresh tracks of several
audad and a jerboa.
Intensely interested as I am in the secrets of nature’s book I became
completely absorbed in the perusal of this fascinating page, or
perhaps I should say foot-note. Bending over the imprinted tracks in
silent study I became aware of a soft tread on the sand back of me.
I turned my head silently but though I made the motion with the
greatest caution it was enough to stampede a flock of seven
magnificent whiffle-hens, birds of the utmost rarity, a cross between
the ostrich and the bustard.
They were off at once, loping across the desert with that supremely
easy and deceptive swing of their slightly bowed legs, traveling at a
gait which breaks the heart of the swiftest horse, their snowy
plumes gleaming in the sunshine. But what brought me up all
standing was the fact that the leader of the flock sported in the
center of his tail-feathers a gorgeous ostrich plume which very
evidently did not belong there. For it was bright blue!
On the instant I recognized it as the ornament worn by Lady
Wimpole at the Casino in Monte Carlo!
A second later I was rushing pell-mell back to camp to rouse Ab-
Domen and make preparations for pursuing the rapidly vanishing
whiffle-hens.
Fortunately my faithful dragoman had had the foresight to include in
the caravan a number of fleet Arabian steeds for just this sort of
sudden foray or side-excursion. I selected Whinney as my
companion and we were soon mounted in the deep, Moroccan
saddles, bits and bridles jingling with bells, burnouses flapping and
long guns projecting at dangerous angles. The animals were frantic
to be off, rearing, snorting, glaring with blood-shot eyes and blowing
foam over the grooms who clung on madly like hounds at a fox’s
throat until I gave the word “Marasa!”—“Cast off!”
Off we flew like arrows. It would have been more impressive had we
both gone in the same direction. As it was the effect was somewhat
scattered and it was ten minutes before Whinney and I re-convened
two miles from the encampment and were able to lay a course in the
supposed direction of the birds. Our brutes had now calmed down
but were still mettlesome and we seemed to fly over the sandy floor,
eagerly scanning the horizon. Fortune favored us. The flock had
stopped to feed among some low-growing ground-aloes and we
came on them suddenly in a fold of the plain.
Reining up I motioned Whinney to move with caution. We must
rouse but not frighten them if we hoped to keep within range.
Cupping my hands I gave a close approximation of the cry of the
African whimbrell, a small but savage bird which is the bane of the
whiffle-hen whom it pesters by sudden, unexpected attacks. The
flock moved on at once looking about and paying no attention to us
as long as we remained at a distance.
Thus we proceeded for the better part of the morning. The sun’s
heat was becoming dangerous. According to all laws of desert travel
we should have been safely sheltered in our tents but I kept on
obstinately. My theory was this; whiffle-hens, owing to the value of
their plumage, are often caught, corralled and domesticated as is
the ostrich. That this was the case with the birds we were following
was evident from the presence among them of Lady Wimpole’s blue
feather. They might well have been part of her caravan, have broken
bounds and launched out for themselves. On then, ever on! Fortune
favors the obstinate!
As if to corroborate my thought, things began to happen. The
whiffle-hens suddenly stopped in their tracks and stood peering
forward. By moving to one side I noticed what their mass had
concealed, namely a few palm trees and tents at no great distance,
the occupants of which had apparently seen the birds approaching.
To one side was a temporary corral, its gate invitingly open.
Sensing the psychological moment I gave the word to Whinney and
with a loud cry we sped forward. The whiffle-hens caught by this
unexpected onslaught dashed onward, instinctively rushing into their
old quarters outside of which we drew rein, to be praised,
congratulated and wondered at by the desert patriarch who had
given up his precious creatures as lost. Bending low he ground his
face in the earth, raising his head only to blow out small clouds of
sand—for he was of that odd sect, the Ismilli or sand-blowers—
mixed with a volley of laudatory expletives.
It was unmistakably the Wimpoles’ caravan. Hampers, hold-alls,
English-tents and impedimenta were everywhere in evidence.
“Where are they, the Lords of your destiny?” I questioned.
The old hen-shepherd blew out a final cloudlet of sand.
“Yonder is their dwelling: the silken tent neath the third palm. They
are but just now risen.”
Dismounting and throwing my reins to the native I strode off in the
direction indicated. As I drew near the tent I paused.
Voices were raised in altercation. Far be it from me to be eaves-
dropper to a private family-quarrel, which, alas, I feared was an all
too frequent occurrence in the lives of this mismated pair. Ready to
withdraw I hesitated when a particularly sharp interchange forced a
decision. A burst of laughter was followed by a man’s voice crying
hoarsely—“By God, I’ll cut your throat!” Then a shriek rang out. It
was high time to interfere. A fight may be private but a murder is
not. Drawing aside the curtain I leapt into the tent.
“Hold!” I cried. “Stay thy hand: infidel son of a swineherd’s sister; or
by the beard of the Prophet thou perish’st.”
The speech was entirely impromptu and I thought it sounded well,
but somehow it fell flat.
Lord Wimpole was alone. He was shaving.
“I was speakin’ to that dam’ parrot,” he said brandishing his razor
toward Selim who was twisting about and making a noise like sick
automobile-gears. “Who are you, may I ask?”
How low the fellow was! ... and how contemptible he looked, his
face half shaved, half lumpy with lather. One of life’s bitter jokes is
that practically every man must shave. As I thus philosophized the
curtains of an adjoining apartment opened and She appeared.
Heavens! how beautiful she looked. She en dishabille, clutching
about her golden body the folds of a dazzling silk kimono, purple
shot with green. Her hair was down: being bobbed it was, of course,
always down, and her blue eyes were filmy with sleep.
“Doctor....” she began.
I checked her with an imperious gesture in which was expressed the
boundless freedom of the fiery Arab race.
“El Sheik Abdullah-el-Dhub ak Moplah,” I announced.
Lord Wimpole was plainly impressed. Hastily finishing his left cheek
he extended his hand.
“’Oly mackerel ... a real Sheik. Put’er there. I’m a lord meself.”
Ignoring his effusion I spoke solemnly.
“Leagues have I ridden, I and my faithful follower, tracing the flight
of birds, yea, even of the swift-skimming whiffle-hens, which ever
drew nearer to their home even as my falcon-heart drew nearer to
its nest, the tent of the most beautiful.”
I glanced at Lady Sarah who never batted an eye though one lovely
lid drooped ever so slightly. Continuing I said, in part.
“And now, the journey done, I am a-weary and would fain repose
myself in the light of the gazelle’s eyes. My charger rests neath the
nodding fig-tree and my soul is parched and a-thirst.”
This was a craftily contrived bit. Wimpole gaped through most of it
but got the final word.
“Thirst” ... he cried. “Gad, I should say so. Me too. Jolly good idea.”
A moment later, her ladyship having retired, Wimpole, Whinney and
I raised tall beakers of superb Scotch to my heartfelt toast, “the
loveliest lady in the world.”
Would she hear me? I wondered. A husky voice from behind the
curtain answered my hope:
“Lads, pass one in to me.”
Chapter V
Love and Lions
Chapter V
The afternoon, it appeared, was to be given over to a lion hunt in
spite of the objections of Effendi-Bazam, the Karawan-bashi or
leader of the Wimpole party which, by the way, was as ill-organized
and amateur an outfit as I have ever seen. We were now not far
from the southern edge of the Ahaggar Plateau which thrusts its
spurs into the desert like the stony fingers of a giant hand clutching
at the sands. The ravines between the fingers were an ideal lurking
place for desert lions, mangy, ill-favored beasts but far more sporty
than their South African brothers.
Effendi-Bazam was an undersized ottoman, hardly higher than a
foot-stool. He was thoroughly desert-broken but as timorous as a
hare.
“Great danger!” he cried, pointing northward when the hunting
expedition was proposed. “Great danger.”
“Danger from what ... the lions?” I asked.

A DESERT DIANA
“The afternoon, it appeared, was to be given over to lion-
hunting.”
A Desert Diana

He shook his head and I saw a convulsive swallow traverse the


length of his triplicate chins. Then he motioned me aside, out of ear-
shot of the others.
“Not lions,” he whispered, “but worse ... a madder, wilder beast. O,
listen, I pray, important Sheik el-Dhub, listen and heed. We are in
the land of Azad,—Azad the Terrible. In yonder defiles he lurks and
who so ventures therein is defiled.”
I should mention in passing that there was no suspicion of a pun in
Effendi’s original statement which was delivered in the Astrachan
dialect: the horrid thing is unavoidable in an honest translation.
“Azad!” he continued,—“you have heard of him? Murder, blood,
rapine ... they are but beads on his rosary. O, magnificent Moplah, I
fear for our lives ... for our lady. Ai! Ai!”
He lay grovelling at my feet.
“Rise, Effendi,” I ordered. “Due caution will be exercised.”
Without understanding my words he departed, comforted.
Azad! small wonder that at the mention of his name my face had
assumed its sternest, cruellest expression, for it is a name which is
almost unspeakable in the mouth of any self-respecting desert
denizen. In every story of the desert which I have studied there is
one Sheik who is described as the cruellest man in the world. To put
the matter arithmetically, these men added together equal one-half
of Azad. That is how wicked he was.
He was said to be the son of a Spanish murderer who, having
escaped from the bastilliano at Cadiz, lived for a time with a gypsy
woman of unknown origin. Azad was the result. From his earliest
years he was an outlaw and defy-er of authority. Swaggering,
brawling, killing, making love, he roamed from one Mediterranean
port to another, gathering about him a following of riff-raff and
ne’er-do-wells. Then came his notorious abduction of Miss Sedley
from the mission station at Fez. This outrage assumed international
proportions. Our government, after a sharp interchange of notes
with France, proposed a punitive expedition. Two months later
President Felix Faure was assassinated. Then rumors began to leak
out that Miss Sedley did not wish to be rescued and the affair was
dropped.
From that time the name of Azad became a synonym for unbridled
license. Many a time I have heard the fishermen along the Moroccan
coast say, as the thunder rolled among the coast-ranges. “Aha; there
is old Azad, laughing at the law!”
If we were near Azad we were near violence, that was certain, but
you may be sure I said nothing of this to the others since there was
naught to be gained by alarming them. I had another and better
plan. I must divert them from their proposed expedition into the
hills.
About four in the afternoon when the sun was beginning to lose its
violence the horses were saddled and the gun-bearers gathered
under the palm trees, Effendi meanwhile becoming more and more
anxious.
“Milady,” I said, addressing Lady Sarah who had just come out of her
dressing tent, “have you ever hunted desert lions before?”
“Only yesterday,” she replied, “but we’d no luck. Not so much as a
whisker did we see.”
“We didn’t go far enough,” put in Lord Wimpole. “Effendi stuck about
the edges of the hills.”
“Curious ...” I mused, “that you saw no lions ... for there are plenty
of them there ... and yet....”
“Wot are you drivin’ at?” blustered Wimpole. “Wouldn’t we of seen
’em if they’d been there?”
This was just what I wanted.
“Not necessarily,” then, as if the thought had just occurred to me.
“By jove; this is an ideal place for netting lions!”
Both Lord and Lady Wimpole were instantly intrigued.
“What ho?” they cried simultaneously.
“Here is the idea,” I explained. “Over there is typical lion country,
nothing there but sand and lions. But you can’t see them; nature
takes care of that, you know, protective coloration. Tawny, yellowish
beasts—they’re invisible at ten feet. But they can be caught. How
many camels have you?”
“Twenty-two” supplied Effendi.
“Good. Take all the nets that go over their loads and fasten them
together. Quick.”
“Do as the Sheik says,” said Lord Wimpole.
An hour later we were ready, the camel nets in a huge ball being
rolled easily over the desert. About three miles distant I had noted a
rocky flume which narrowed at its lower end. It was ideal for my
purpose. Spreading the nets below I ran a strong camels-hair rope
through the outer edges making a gathering string which was then
carried up and over the projecting rock. At my direction a score or
more of doolahs began prodding the high bank of sand that rose
between the rock-walls of the gorge. First in a slow trickle, then in a
steady stream the sand slid down into the nets. Occasionally a large
mass would fall in which I thought I detected a flurried motion but,
from our distance, I could not be sure. When the sand had piled
itself to a height of about twelve feet, the base of the symmetrical
cone reaching to the edge of the nets I gave a word of command,
“Now!” and the doolah-boys began pulling hastily at the gathering-
rope. The edge of the nets rose neatly, closing-in around the top of
the cone. Phase one of my operation was complete.
Next came the final and exciting step of freeing the nets of sand.
This was accomplished by yawing the gathering-rope violently from
side to side until the net was sufficiently loosened to allow its being
dragged across the desert floor. Twice, thrice the sturdy doolahs
hurled their bulks on the rope.
“She starts ... she moves!” shouted Whinney.
Once in motion, the sand spun rapidly through the meshes until it
was reduced to a small mass in the center of which I could detect
two vague, but furiously revolving forms ... lions!
“Spearmen, ready!” I commanded, for it does not do to be
unprepared.
Lord Wimpole, express-rifle in hand, was apoplectic with excitement.
“Do we shoot ’em?” he cried.
“No ... no!” I motioned him back. “They will kill each other.”
Sure enough, after a few moments’ fearful clawing and growling the
fierce struggle amid the strong meshes quieted down. Two
precautionary shots into the net, and the battle was over. At our feet
lay the mangled remains of two tawny lions, exactly matching the
shade of the surrounding sand.
“For milady’s boudoir.” I said quietly. “In my own country we do it
with a sieve; it is much simpler.”
“’Straordinary!” said Lady Wimpole giving me a meaning look from
her brilliant eyes, and we made our way back toward the camp
voting the affair a complete success.
We dined in state in the Wimpoles’ dining-tent. It was a lucullan
repast of European delicacies varied with African dishes superbly
cooked by a French chef; hors d’œuvres, a delicious thin soup,
audad steak and Egyptian quail succeeded each other, each course
being marked by its appropriate wine from sherry through the whites
and reds to cognac.
“Couldn’t bring any champagne”; apologized Lord Wimpole through
a mouthful of quail, “tried to but it blew up. No ice in the dam’
desert?”
Lady Sarah looked on coldly as her husband passed through the
familiar phrases of garrulity, incoherence and speechlessness. She
rose disdainfully just as his lordship slipped heavily from his camp
chair. “May I speak to your ladyship a moment ... alone.” I
murmured.
She nodded.
“Effendi, remove his lordship.”
I followed her out under the cool stars, whispering to Whinney as I
passed, “Get the horses ready, we must away.”
At the edge of the oasis Lady Sarah paused and faced me. We were
alone—at last! Overhead a million eyes looked down from the
twinkling gallery of heaven; far to the west a gibbous moon shone
palely; night enveloped us—in fact it was going on midnight.
Clearing my throat I began.
“O woman, strange and mysterious, lamp of my life, it is not for me
to rend the veil of thy secrecy, but my soul is eager in its questioning
and my heart cries for an answer. Tell me, if thou so will’st, why
did’st thou fly from thy nest when thou had’st made tryst with me at
the police-station?”
To my delight she caught the elevation of my style at once and
replied unhesitatingly.
“Listen, O desert-man, Sheik Adullah-el-Dhub, and let thy heart
attend, for oft has my own voice upbraided me that I did thus walk
out on thee. Know then that it was not my will but that of the Sheik
Wimpole, my over-lord, that hurried me hither-ward.”
Though I winced at the reference to her over-lord I could but admire
her fluent mastery of the nomadic tongue.
“He it was,” she continued, “who plucked me from thy side, fearing
the long delays of the law. But thou gottest my message?”
“Yea, Princess—” I answered, at which she smiled, pleased evidently,
at the promotion,—“Yea, even so,—and thy signal plume likewise.
’Twas well contrived the matter of the whiffle-hens. Trust thy
woman’s wit.”
“’Twas simple,” she answered. “They were in the keeping of Kashgi,
the sand-blower, an ancient stupid. Under guise of petting the bell
hen I affixed my feather. Something told me they would find you, O
Great South-wind.”
Her words moved me deeply.
“Straight as the thrown lance or the sped arrow,” I cried, feeling that
the moment for tender mastery had come, “so came thy harbinger
to me, O woman of bronze and gold. Allah be praised, whose hand
hath guided me since that first fair evening when at the ocean’s
edge I marvelled at thy sky-line!”
She looked down at me, for she was slightly taller than I—tenderly,
her rugged contours softened and beautified in the silver light. It
was like moonlight on a cliff. My heart pounded furiously—her
presence, the silence of the desert ... the cognac.... I was fired by
emotion. Drawing myself up to her full height I stretched out my
arms.
“O, Woman——”
On the instant I paused, thunderstruck. Far away on the northern
horizon a light gleamed for a moment and was gone. Was it fact or
fancy that made me think I saw a vague shape in the shadows
before me. Instantly the thought of Azad flashed through my mind
and brought me to my senses.

ALONE AT LAST

“I was fired by emotion. Drawing myself up to her full


height I stretched out my arms.
‘O, woman....’”
Alone at Last

“Lady Sarah,” I said hurriedly—“I must defer what I was going to say
until another time. I was forgetting what made me ask for this
interview—the night—your beauty—but the point is this. You, we, all
of us are in imminent danger. On the hills yonder lies the camp of
Azad the Terrible!”
I could see her pale in the moonlight.
“Even now his spies are probably prowling about, watching your
camp, counting your men, your camels, your—women.”
“What would you suggest?” she asked tremulously.
“Flight—” I replied boldly.
Her glance expressed both surprise and disappointment.
“Yes,” I repeated harshly, “flight! I have never been afraid to be
cautious. Listen, Lady Sarah. Your caravan is ill-equipped. Effendi is
strong on commissary but weak on munitions. There is but one thing
to be done. We must consolidate. Azad will not attack tonight; he
knows I am here. At dawn strike camp and remove to the
Southward. In the meantime I will speed to my own men and
summon them to your assistance. There is not a moment to be lost.”
Hastily retracing our steps we reached the camp where, at the portal
of the luxurious tent, I bent over Lady Sarah’s hand, lightly brushing
her firm knuckles with my lips.
“Farewell,” I breathed. “Remember, strike camp at dawn. Be of good
heart—and do not forget—the Sheik Abdullah-el-Dhub.”
“How could I?” she whispered, smiling strangely.
As she lifted the tent curtain I had a glimpse of the elaborate
interior, hung with silken draperies and furnished with many-hued
cushions and a broad low divan over the edge of which, upside
down, hung the brutish face of Sir Horace Wimpole.
“Her over-lord!”——
Ugh! A shudder of revulsion shook me.
A moment later Whinney and I were rushing through the night like
great white birds while in my heart echoed the words of an old
Persian love song—
“Farewell, farewell, my sweet gazelle,
With ruby eyes——”

You might also like