Download Programming 101: Learn to Code Using the Processing Programming Language, 2nd Edition Jeanine Meyer ebook All Chapters PDF
Download Programming 101: Learn to Code Using the Processing Programming Language, 2nd Edition Jeanine Meyer ebook All Chapters PDF
com
https://ebookmeta.com/product/programming-101-learn-to-code-
using-the-processing-programming-language-2nd-edition-
jeanine-meyer/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/the-essential-guide-to-html5-using-
games-to-learn-html5-and-javascript-3rd-edition-jeanine-meyer/
ebookmeta.com
https://ebookmeta.com/product/c-programming-learn-to-code-1st-edition-
sisir-kumar-jena/
ebookmeta.com
https://ebookmeta.com/product/programming-for-absolute-beginners-
using-the-javascript-programming-language-1st-edition-jonathan-
bartlett/
ebookmeta.com
https://ebookmeta.com/product/air-b-d-books-one-three-
airb-d-1-3-olivia-joy/
ebookmeta.com
Principles and Practice of Modern Chromatographics Methods
2nd Edition Kevin Robards
https://ebookmeta.com/product/principles-and-practice-of-modern-
chromatographics-methods-2nd-edition-kevin-robards/
ebookmeta.com
https://ebookmeta.com/product/new-frontiers-in-environmental-
toxicology-1st-edition-tanu-jindal/
ebookmeta.com
https://ebookmeta.com/product/decision-sciences-for-covid-19-1st-
edition-said-ali-hassan/
ebookmeta.com
Okinawan Women s Stories of Migration From War Brides to
Issei 1st Edition Johanna O. Zulueta
https://ebookmeta.com/product/okinawan-women-s-stories-of-migration-
from-war-brides-to-issei-1st-edition-johanna-o-zulueta/
ebookmeta.com
Programming 101
Learn to Code with the Processing
Language Using a Visual Approach
Second Edition
Jeanine Meyer
Programming 101: Learn to Code with the Processing Language Using a Visual
Approach
Jeanine Meyer
Mt Kisco, NY, USA
Introduction������������������������������������������������������������������������������������������������������������xxi
Chapter 1: Basics����������������������������������������������������������������������������������������������������� 1
Abstract����������������������������������������������������������������������������������������������������������������������������������������� 1
Programming Concepts���������������������������������������������������������������������������������������������������������������� 3
Programming Languages and Natural Languages������������������������������������������������������������������ 3
Values and Variables��������������������������������������������������������������������������������������������������������������� 3
Functions��������������������������������������������������������������������������������������������������������������������������������� 5
Specifying Positions and Angles���������������������������������������������������������������������������������������������� 6
Colors�������������������������������������������������������������������������������������������������������������������������������������� 7
Development Environment������������������������������������������������������������������������������������������������������ 7
Role of Planning���������������������������������������������������������������������������������������������������������������������� 8
Under the Covers�������������������������������������������������������������������������������������������������������������������������� 8
Processing Programming Features����������������������������������������������������������������������������������������������� 9
Processing Development Environment������������������������������������������������������������������������������������ 9
Functions������������������������������������������������������������������������������������������������������������������������������� 11
Angles������������������������������������������������������������������������������������������������������������������������������������ 12
Implementing Hello, World���������������������������������������������������������������������������������������������������������� 14
Implementing the Daddy Logo���������������������������������������������������������������������������������������������������� 22
Planning��������������������������������������������������������������������������������������������������������������������������������� 22
Daddy Logo Program������������������������������������������������������������������������������������������������������������� 25
v
Table of Contents
Chapter 2: Interactions������������������������������������������������������������������������������������������� 33
Abstract��������������������������������������������������������������������������������������������������������������������������������������� 33
Note��������������������������������������������������������������������������������������������������������������������������������������� 33
Programming Concepts�������������������������������������������������������������������������������������������������������������� 35
Events������������������������������������������������������������������������������������������������������������������������������������ 35
Randomness�������������������������������������������������������������������������������������������������������������������������� 36
Displaying Images from Files������������������������������������������������������������������������������������������������ 36
Calculations, Including Built-in Functions����������������������������������������������������������������������������� 36
Looping���������������������������������������������������������������������������������������������������������������������������������� 37
Processing Programming Features��������������������������������������������������������������������������������������������� 37
Note��������������������������������������������������������������������������������������������������������������������������������������� 38
Under the Covers������������������������������������������������������������������������������������������������������������������������ 41
Polygon Sketch Operation Overview������������������������������������������������������������������������������������������� 42
Implementing the Polygon Sketch���������������������������������������������������������������������������������������������� 44
Planning��������������������������������������������������������������������������������������������������������������������������������� 44
Polygon Sketch Program������������������������������������������������������������������������������������������������������� 47
Coin-Toss Sketch Operation Overview���������������������������������������������������������������������������������������� 49
Implementing the Coin-Toss Sketch������������������������������������������������������������������������������������������� 52
Planning��������������������������������������������������������������������������������������������������������������������������������� 52
Things to Look Up����������������������������������������������������������������������������������������������������������������������� 56
How to Make This Your Own������������������������������������������������������������������������������������������������������� 56
What You Learned����������������������������������������������������������������������������������������������������������������������� 57
What’s Next��������������������������������������������������������������������������������������������������������������������������������� 58
vi
Table of Contents
vii
Table of Contents
Chapter 4: Classes�������������������������������������������������������������������������������������������������� 85
Abstract��������������������������������������������������������������������������������������������������������������������������������������� 85
Programming Concepts�������������������������������������������������������������������������������������������������������������� 86
Classes���������������������������������������������������������������������������������������������������������������������������������������� 86
Phases of Operations������������������������������������������������������������������������������������������������������������� 87
Tolerance or Margin��������������������������������������������������������������������������������������������������������������� 88
Processing Programming Features��������������������������������������������������������������������������������������������� 88
Classes���������������������������������������������������������������������������������������������������������������������������������� 88
Definition of Images, Rectangles, and Ellipses���������������������������������������������������������������������� 90
Dynamic Arrays��������������������������������������������������������������������������������������������������������������������� 90
Tolerance and OK-So-Far Coding������������������������������������������������������������������������������������������ 92
Bouncing Objects Overview�������������������������������������������������������������������������������������������������������� 92
Implementing the Bouncing Objects������������������������������������������������������������������������������������������� 94
Planning��������������������������������������������������������������������������������������������������������������������������������� 94
Program��������������������������������������������������������������������������������������������������������������������������������� 96
Make Path and Travel Path Overview���������������������������������������������������������������������������������������� 100
Implementing the Make Path and Travel Path�������������������������������������������������������������������������� 103
Planning������������������������������������������������������������������������������������������������������������������������������� 104
Program������������������������������������������������������������������������������������������������������������������������������� 105
Jigsaw Overview����������������������������������������������������������������������������������������������������������������������� 109
Implementing the Jigsaw��������������������������������������������������������������������������������������������������������� 111
Planning������������������������������������������������������������������������������������������������������������������������������� 111
Program������������������������������������������������������������������������������������������������������������������������������� 114
Under the Covers���������������������������������������������������������������������������������������������������������������������� 125
Things to Look Up��������������������������������������������������������������������������������������������������������������������� 126
How to Make This Your Own����������������������������������������������������������������������������������������������������� 126
What You Learned��������������������������������������������������������������������������������������������������������������������� 127
What’s Next������������������������������������������������������������������������������������������������������������������������������� 127
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
xi
Table of Contents
xii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 343
xiii
About the Author
Jeanine Meyer is Professor Emerita at Purchase College/
SUNY. Before Purchase, she taught at Pace University and
prior to that was a manager and research staff member
at IBM Research in robotics and manufacturing. She also
worked as a research consultant at IBM for educational grant
programs.
She was moved to create this book because of a general
wish to make programming less mysterious and more
appealing while featuring the challenges. She enjoys
spending time with favorite pictures and video clips as well as producing programs. The
chance for a new edition provided a reason to explore p5.js, tools for using JavaScript
with features from Processing.
She is the author of five books and coauthor of five more on topics ranging from
educational uses of multimedia, programming, databases, number theory, and origami.
She earned a PhD in computer science at the Courant Institute at New York University,
an MA in mathematics at Columbia, and an SB (the college used the Latin form) in
mathematics from the University of Chicago. Recently, she has given lectures, in-person
and remotely, connecting origami, mathematics, and computer science as well as the
use and misuse of math in the news. She is a member of Phi Beta Kappa, Sigma Xi, the
Association for Women in Science, and the Association for Computing Machinery.
Jeanine is trying but remains a beginner at Spanish and piano.
xv
About the Technical Reviewer
Joseph McKay is an associate professor of new media. He primarily teaches new
directions in virtual space, programming for visual artists, intro to physical computing,
hacking the everyday, senior seminar, and web development.
Joe’s work is focused on interactive art games. He makes games that have their roots
in fine art but are also fun and easy to play. He is currently working on a VR art game
with innovative locomotion.
xvii
Acknowledgments
Much appreciation to the subjects of the illustrations in this book, starting with my father
(Joseph) and including my mother (Esther), Aviva, Grant, Liam, and especially Annika.
Thanks to my children, Aviva and Daniel, for the photography, video, and computer
graphics work.
My students, teaching assistants, and colleagues always provide ideas, stimulation,
feedback, and advice. Thanks especially to Irina Shablinsky for her efforts in teaching me
Processing and how to teach Processing and introducing me to Takashi Mukoda. Thanks
to David Jameson, whose comments and concerns made me produce the “Under the
Covers” section for each chapter.
Thanks to the crew at Apress/Springer Nature, including for the second edition
James Robinson-Prior, Jessica Vakili, Dulcy Nirmala, Krishnan Sathyamurthy, and others
I do not know by name. Much appreciation to the past technical reviewers, Massimo
Nardone and Takashi Mukoda, and the technical reviewer for this edition, Joe McKay,
who brought his considerable talent and experience to the task.
xix
Introduction
Processing is a programming language built on top of another programming language
called Java. To quote from the https://processing.org page, “Processing is a flexible
software sketchbook and a language for learning how to code within the context of the
visual arts.” The term for a program in Processing is sketch. However, Processing can be
used to create applications that are far more than static sketches. You can use Processing
to create dynamic, interactive programs. It is a great tool for learning programming.
Though Processing was created for visual artists, it serves a broad population of
people. In particular, at Purchase College/SUNY, Processing has been an excellent first
computer programming language for our computer science/mathematics majors and
minors. It also serves students across the college, who take our CS I course to satisfy
one of the general education requirements. This experience has been reported in other
places. Processing and this text also are appropriate for self-study.
The ten chapters in this book share a common design and structure. My goal is to
introduce you to programming, focusing on the Processing language. In each chapter, I
explain general programming concepts and specific Processing features through the use
of one or more specific examples. The code and files such as image files are combined
as zip files and available at https://github.com/Apress/Programming-101. I hope the
examples are entertaining; the goal, however, is not for you to learn the specific examples
but instead understand the concepts and features. The way to learn programming is to
make these examples “your own” and to go on to do a lot of programming.
The introduction to each chapter starts with a brief description of the concepts
and programming features used and the examples; then you need to be patient while
I provide background. Each chapter includes a discussion of general “Programming
Concepts” prior to plunging into the details. These are not limited to the Processing
language but are present in most programming languages. Presenting the concepts in a
general way might help you if you are coming to this book knowing another language or
you hope to move on to another language someday.
Next, I describe the “Processing Programming Features” that are used to realize
those concepts and produce the examples. This section will have actual code in it and
maybe short examples. This is a spiral approach, going from the general to the specific.
xxi
Introduction
A section called “Under the Covers” describes what Processing is doing for us behind
the scenes and the relationship between Processing and Java. This section appears
in different places in each chapter. It might be of more interest for readers who know
something or want to know something about Java, but I urge everyone to give it at least a
quick scan.
I then provide an overview of each example, with screenshots showing the operation
of the program. Please note that in some cases, I have modified the programs to obtain
the screenshots. I then go on to describe the implementation of the example, which
contains a “Planning” and a “Program” section. The “Planning” section is where I
describe my thought process. Programs do not spring into existence—at least for me—
not like Mozart composing a symphony, which was said to emerge all at once from his
mind. It is an iterative process for most of us. This section contains a table indicating the
relationship of the functions. The “Program” section includes a table with one column
for code and another column with an explanation of that line of code. These tables are
long and are not meant to be read as poetry or fine literature. Instead, skip around. Use
the function relationship table. If you download the code and try it out, you can use this
section to improve your understanding of the program. The most critical step is to make
changes, and I provide suggestions in the “How to Make This Your Own” section. This
set of sections is repeated for each example.
A section titled “Things to Look Up” will contain a list of Processing features related to
the ones described in the chapter. Processing is a large language, and it is growing. I can
show you only a small subset of the features, and each feature is used in one way, perhaps
using default values. You can and should consult other references to learn more. You
can look things up in multiple ways. For example, you can go to the website at https://
processing.org/reference/ and just keep that open. Alternatively, if you want to look up
how to draw a rectangle in Processing, it can be efficient to enter “processing.org rectangle”
into Google (or another search engine) or the address field of browsers such as Chrome to
retrieve a list of possible sites. It is best to use “processing.org” because “processing” is a
common English word. You can try “Processing rectangle,” but you will need to skip over
some sites that have nothing to do with the Processing language.
Remember that the goal of this book is not to teach you how to make my examples,
from peanut-shaped bald men to my versions of certain games to rotating 3D cubes with
photos of my grandchild, but to help you understand how to make your own programs!
Make small changes and then large changes. Make your own programs! Chapters will
close with two more sections: a brief review, “What You Learned,” and “What’s Next.”
xxii
Introduction
The book also has an Appendix describing what is called p5.js. This is a way to
produce programs for the Web by providing a Processing Library to use with JavaScript.
The Processing organization also supplies an online editor.
You are welcome to look at the chapters in any order, but later examples do depend
on an understanding of concepts introduced earlier. Moreover, because one of the
main techniques of programming is to reuse code, there are many instances of later
examples copying parts of earlier examples. Do not be concerned: the tables in the
“Implementation” section contain complete programs. It is beneficial for your learning
process to recognize the repetition.
Please do take a pause in reading to explore, experiment, and, I repeat, make your
own programs. Learning how to program is critical for understanding how we function
in today’s world and the requirements and challenges of devising algorithms using logic
and data. Learning to program might help you get a job. However, the main thing that
drives me, and I hope will drive you, is that it is fun.
Enjoy,
Jeanine
xxiii
CHAPTER 1
Basics
Abstract
The goal of this chapter is to get you started. The programming example will be a static
drawing of two cartoonish figures, as shown in Figure 1-1. Be aware that the examples
in subsequent chapters will increase in complexity, as we will be producing programs
that are highly interactive and, possibly, involving random effects, reading files, and
exhibiting behavior based on various conditions.
1
© Jeanine Meyer 2022
J. Meyer, Programming 101, https://doi.org/10.1007/978-1-4842-8194-9_1
Chapter 1 Basics
The Daddy logo is a version of a drawing my father would make, often as his
signature on a letter or note or artwork. I hope that you will design or recall a drawing
or symbol that has meaning to you and makes you happy the same way this cartoonish
peanut-shaped, bald guy makes me.
We will need to do some work to start us off and get to the point that the coding
is clear, but it is not too difficult. The traditional first task in using any programming
language is to get the program to display the phrase “Hello, world.” This works well in
demonstrating several important concepts, including what happens if the programmer
makes certain types of errors. Because of the features built into Processing, you can
produce a pretty fancy version of “Hello, world.”
Be patient with me and with yourself. At the end of the chapter, you will be able to
implement your own Daddy logo.
2
Chapter 1 Basics
Programming Concepts
This section, included in each chapter, is to provide a general introduction to concepts.
I begin with comparing and contrasting programming languages with natural languages.
3
Chapter 1 Basics
String should start with a capitalized “S”. The B in Boolean can be upper or
lowercase. The data type is named for George Boole, an English mathematician credited
with originating symbolic algebra.
Our programs can include literal values such as 5, 100.345, and “Hello” in the
code. In addition, a feature in all programming languages is what is termed variables.
A variable is a construct for associating a name of our choosing with a value. We can
initialize the variable, change it, and use it in an expression; that is, the value associated,
often termed in the variable, can vary, that is, change. Using variables makes our
programs less mysterious. Moreover, we can define one variable in terms of another,
making relationships explicit and preventing certain errors. In Processing, Java, and
some, but not all, programming languages, variables need to be declared, or set up
before use. One characteristic of variables is termed scope, which indicates what code
has access (e.g., global variables vs. local variables), but that is best explained later.
The following are examples of Processing statements. Explanation is given in
comments and later.
The // indicates that the rest of the line is a comment, meaning that Processing
ignores it. It is intended for readers of the code, including you, to make things clear. You
also can use the delimiters /* and */ for long comments.
4
Chapter 1 Basics
Note
My examples, because they are surrounded by explanations, tend not to have as many
comments as I would use outside of teaching and writing books.
There are rules for variable and function names in all programming languages.
Generally, they must start with a letter, uppercase or lowercase, and cannot contain
spaces. The most important guidance for naming is that the names should have meaning
for you. The programming language will accept single character names or names with no
apparent meaning, but these will not be helpful when you are trying to recall what you
were trying to do. So-called camel casing, as in classSize, can be helpful.
A single equal sign (=) means assignment and is used in what are called, naturally
enough, assignment statements and initialization statements. The statement
classSize = classSize + 5;
Functions
Programming work in any language is structured into units. One important way of
structuring code comes with different names: function, procedure, subroutine, method.
These are ways of packaging one or more statements into one unit. You will read about
functions in the “Processing Programming Features” section and methods in the “Under
the Covers” section. Briefly, functions are defined, and functions are invoked. I can give you
directions , perhaps orally, perhaps by text, to my house, which is analogous to defining a
function. At that point, I am not directing you to come to my house. At some later time, I can
direct you to go to my house, and this is analogous to invoking the function.
5
Chapter 1 Basics
Programs can be considerably shorter as well as easier to modify through the use of
functions and variables, so understanding both of these concepts is important. You do
not need to accept this or understand this right now. It will be demonstrated later by my
sketch for displaying two Daddy logos that takes just one statement more than displaying
the Daddy logo just once.
If you say to yourself “This is upside down,” then I know you understood. Another
important point is that the unit is very small, so if your code positions something at
100, 200 and later at 101, 201, you probably will not detect the difference. Your intuition
regarding this will improve with experience.
6
Chapter 1 Basics
Note
As a teaser, Processing has facilities for 3D as well as 2D. We get to 3D in later chapters.
In this chapter, my Daddy logo has a smile made by specifying an arc of an ellipse. To
produce the arc, I need to write code to indicate a starting angle and an ending angle of
the arc. The system used in most computer languages is not the standard one in which
a right angle is 90 degrees, a U-turn is a 180, and snowboarders do 1800s. (I am writing
this during the Olympics, and yes, snowboarders did tricks measuring 1800 and bigger.)
It might be upsetting to realize this, but the notion of degrees with a circle consisting of
360 degrees was invented by people. I typically offer my students extra credit to identify
where and when this happened. Instead, in most programming languages, we use a
measure called radians. Think of wrapping a circle with lengths equal to one radius. How
many lengths will this take? You know the answer: It is not a whole number, it is 2 times
π, where π is an irrational number often approximated by 3.14159. In our programming,
we will use the built-in values TWO_PI, PI, HALF_PI, and QUARTER_PI. You will see
radians in use, so be patient.
Colors
There are different ways to specify colors in computer languages and computer
applications, and Processing supports more than one. In this text, we stick with
grayscale and RGB (red/green/blue). Because of how these values are stored, the range
of grayscale is from 0 (black) to 255 (white), and the values for redness, greenness,
and blueness are specified by a number from 0 to 255. This approach is used in many
applications. If you want to use a certain color that you see in a photo, you can open the
image file in Adobe Photoshop or the online Pixlr or some other graphics tool and use
the eye drop on the pixel (picture element) you want, and an information window will
tell you the RGB value. See also the mention of the Color Selector in the “Things to Look
Up” section.
Development Environment
Programmers need to prepare programs and test programs. We also need to save our
work to come back to it another time. We might need to send the program to someone
else. Processing has what is termed an integrated development environment, the
Processing Development Environment (PDE), which provides a way to prepare and
7
Chapter 1 Basics
make changes to a program as well as test it and save it. To give you a different example,
Hypertext Markup Language (HTML) documents containing JavaScript are prepared and
saved using a text editor, such as Sublime. The resulting files are opened (and run) using
a browser, such as Chrome. In the Appendix, I will show you how to use an editor for
p5.js, which is a version of JavaScript incorporating Processing features.
Role of Planning
I close this first “Programming Concepts” section by noting that preparing programs
such as a Processing sketch generally involves planning and design. It might be best to
step away from the keyboard. Some of the plans might need to be modified when you get
to writing the code, but it is best to have plans!
8
Chapter 1 Basics
The Java program also defines default settings. Processing and other computer
languages and many computer applications provide powerful features. If we needed to
specify each aspect of each feature before anything happens, it would be tremendously
burdensome. It is important to be aware that certain things can be adjusted, though, as
you will see in our very first example later, with the discussion on default values for font,
text size, fill color, and stroke color.
The design and capabilities of Processing provide us a way to get started creating and
implementing our ideas quickly.
9
Chapter 1 Basics
Using Save As… in the PDE produces a folder, in this case named first0, which
contains a file named first0.pde. The examples explored in future chapters will
consist of folders containing additional items. For example, a Processing sketch named
myFamily that makes use of an image file aviva.jpg and an image file daniel.jpg will
be a folder named myFamily containing a file named myFamily.pde and a folder named
data that contains the two files aviva.jpg and daniel.jpg. The relationship of these
files is shown in Figure 1-4.
10
Chapter 1 Basics
Functions
Processing uses the term function for grouping together one or more statements into
something that can be invoked (called). Functions are defined with header statements
and then the body, a sequence of statements, contained within brackets. You will see
in this chapter and every chapter definitions for the setup function, a function that
Processing expects the programmer to supply. The header is
void setup()
The term void indicates that this function does not produce or return a value. The
opening and closing parentheses with nothing between them indicate that this function
does not expect any parameters.
The Daddy logo example includes a function called daddy that does the work of
drawing the cartoon. Its header is
The parameters are the things between the parentheses. The parameter list is the
place for the programmer to give names and specify the data type. This means that when
I wrote the code to invoke daddy, which is necessary because daddy was something I
made up, not anything Processing expects, Processing will check that the values cited in
the call are the correct type.
I feel obliged to show you an example of a function that does produce a value, a
standard one supplied in many textbooks.
11
Another Random Document on
Scribd Without Any Related Topics
unicorn, etc. When cells with raphides and mucilage are mounted in
a mixture of alcohol, glycerine, and water, the mucilage first swells
and finally disappears.
STORAGE CAVITIES
C RY S TA L C AV I T I E S
S E C R E T I O N C AV I T I E S
PLATE 67
Cross-Section of Skunk-cabbage Leaf
(Symplocarpus fœtidus,
[L.] Nutt.)
1. Crystal cavity.
2. Bundle of raphides.
O I L C AV I TY
Canella alba contains an oil cavity resembling in form the
mucilage cavity of elm bark.
Secretion cavities occur in most of the umbelliferous fruits. For
each fruit there is a more or less constant number of cavities. Anise
has twenty or more, fennel usually has six cavities, and parsley has
six cavities.
In poison hemlock fruits there are no secretion cavities. In certain
cases, however, the number of secretion cavities can be made to
vary. This was proved by the author in the case of celery seed. He
found that cultivated celery seed, from which stalks are grown,
contains six oil cavities (Plate 122, Fig. 2), while wild celery seed
(Plate 102, Fig. 1), grown for its medicinal value, always contains
more than six cavities. Most of the wild celery seeds contain twelve
cavities.
Many leaves contain cavities for storing secreted products. Such
storage cavities occur in fragrant goldenrod, buchu, thyme, savary,
etc.
The leaves in which such cavities occur are designated as pellucid-
punctate leaves. Such leaves will, when held between the eye and
the source of light, exhibit numerous rounded translucent spots, or
storage cavities.
G LA N D U LA R H A I R S
S TO N E C E L L S
The stone cells of the different cinnamons (Plate 65, Fig. 1) store
starch grains; these grains often completely fill the stone cells.
The yellow stone cells of calumba root (Plate 65, Fig. 2) usually
contain four prisms of calcium oxalate, which may be nearly uniform
or very unequal in size.
B AS T F I B R E S
The bast fibres of the different rubus species (Plate 65, Fig. 7)
contain starch. The medullary rays of quassia (Plate 107, Fig. 2)
contain starch; while the medullary rays of canella alba contain
rosette crystals. In a cross-section of canella alba (Plate 81, Fig. 3)
the crystals form parallel radiating lines which, upon closer
examination, are seen to be medullary rays, in each cell of which a
crystal usually occurs.
The epidermal and hypodermal cells of leaves serve as
water-storage tissue. These cells usually appear empty in a section.
The barks of many plants—i.e., quebracho, witch-hazel, cascara,
frangula, the leaves of senna and coca, and the root of licorice—
contain numerous crystals. These crystals occur in special storage
cells—crystal cells (Plate 65, Fig. 6)—which usually form a
completely enveloping layer around the bast fibres. These cells are
usually the smallest cells of the plant in which they occur, and with
but few exceptions each cell contains but a single crystal.
The epidermal cells of senna leaves and the epidermal cells of
mustard are filled with mucilage; the walls even consist of mucilage.
Such cells are always diagnostic in powders.
STORAGE WALLS
The cell contents of the plant are divided into two groups: first,
organic cell contents; and secondly, inorganic cell contents.
The organic cell contents include plastids, starch grains,
mucilage, inulin, sugar, hesperidin, alkaloids, glucocides, tannin,
resin, and oils.
CHLOROPHYLL
The chloroplasts of the higher plants are green, and they vary
somewhat in size, but they have a similar structure and form.
Chloroplasts are mostly oval in longitudinal view and rounded in
cross-section view. Each chlorophyll grain has an extremely thin
outer wall, which encloses the protoplasmic substance, the green
granules, a green pigment (chlorophyll), and a yellow pigment
(xanthophyll). Frequently the wall includes starch, oil drops, and
protein crystals.
Chloroplasts are arranged either in a regular peripheral manner
along the walls, or they are diffused throughout the protoplast.
The palisade cells of most leaves are packed with chlorophyll
grains. In the mesophyll cells the chlorophyll grains are not so
numerous, and they are arranged peripherally around the innermost
part of the wall.
Chloroplasts multiply by fission—that is, each chloroplast divides
into two equal halves, each of which develops into a normal
chloroplast.
Chlorophyll occurs in the palisade, spongy parenchyma, and guard
cells of the leaf; in the collenchyma and parenchyma of the cortex of
the stems of herbs and of young woody stems, and, under certain
conditions, in rhizomes and roots exposed to light. Almost without
exception young seeds and fruits have chlorophyll.
In powdered leaves, stems, etc., the chlorophyll grains occur in
the cells as greenish, more or less structureless masses. Yet cells
with chlorophyll are readily distinguished from cells with other cell
contents. In witch-hazel leaf the chlorophyll grains appear brownish
in color. Powdered leaves and herbs are readily distinguished from
bark, wood, root, and flower powders.
Leaves and the stems of herbs are of a bright-green color. With
the exception of the guard cells, the chloroplasts occur one or more
layers below the epidermis; but, owing to the translucent nature of
the outer walls of these cells, the outer cells of leaves and stems
appear green.
Wild cherry, sweet birch, and, in fact, most trees with smooth
barks have chloroplasts in several of the outer layers of the cortical
parenchyma. When the thin outer bark is removed from these
plants, the underlying layers are seen to be of a bright-green color.
LEUCOPLASTIDS
STARCH GRAINS
The chemical substance starch (C₆H₁₀O₅) is formed in
chloroplasts. The starch thus formed is removed from the
chloroplasts to other parts of the plant because it is the function of
the chloroplasts to manufacture and not to store starch.
The starch formed by the chloroplasts is acted upon by a ferment
which adds one molecule of water to C₆H₁₀O₅, thus forming sugar
C₆H₁₂O₆. This sugar is readily soluble in the cell sap, and is
conducted to all parts of the plant. The sugar not utilized in cell
metabolism is stored away in the form of reserve starch or starch
grains by colorless plastids or amyloplasts.
The amyloplasts change the sugar into starch by extracting a
molecule of water. This structureless material (starch) is then formed
by the amyloplast into starch grains having a definite and
characteristic form and structure.
Starch grams vary greatly in different species of plants, owing
probably to the variation of the chemical composition, density, etc.,
of the protoplast, and to the environmental conditions under which
the plant is growing.
OCCURRENCE
OUTLINE
SIZE
The size (greatest diameter) of starch varies greatly even in the
same species, but for each plant there is a normal variation.
In spherical starch grains the size of the individual grains is
invariable, but in elongated starch grains and in parts of compound
grains the size will vary according to the part of the grain measured.
In zedoary starch (Plate 71, Fig. 4), for instance, the size will vary
according to whether the end, side, or surface of the starch grain is
in focus.
The parts of compound grains often vary greatly in size. Such a
variation is shown in Plate 75, Fig. 2.
HILUM
The hilum is the starting-point of the starch grain or the first part
of the grain laid down by the amyloplast. The hilum will be central if
formed in the middle of the amyloplast, and excentral if formed near
the surface of the amyloplast. It has been shown that the developing
starch grain with eccentric hilum usually extends the wall of the
amyloplast if it does not actually break through the wall. Starch
grains with excentral hilums are therefore longer than broad.
PLATE 70
Starch
In central hilum starch grains the grain is laid down around the
hilum in the form of concentric layers. These layers are of variable
density. The dense layers are formed when plenty of sugar is
available, and the less dense layers are formed when little sugar is
available. The unequal density of the different layers gives the
striated appearance characteristic of so many starch grains.
In eccentric hilum starch grains the starch will be deposited in
layers which are outside of and successively farther from the hilum.
The term hilum has come to have a broader meaning than
formerly. Hilum includes at the present time not only the starting-
point of the starch grain, but the fissures which form in the grain
upon drying. In all cases these fissures originate in the starting-
point, hilum, and in some cases extend for some distance from it.
The hilum, when excentral, may occur in the broad end of the grain,
galanga, and geranium (Plate 71, Figs, 1 and 3), or in the narrow
end of the grain, zedoary (Plate 71, Fig. 4).
N AT U R E O F T H E H I L U M
INULIN
MUCILAGE
PLATE 77
Inulin (Inula helenium, L.)
1. Inulin in the parenchyma cells of
dandelion root.
2. Inulin from Roman pyrethrum root
(Anacyclus pyrethrum, [L.] D. C.).
VOLATILE OILS
TANNIN
ALEURONE GRAINS
Much attention has been given to the study of the special parts of
the aleurone grains, but one of the most important diagnostic
characters has been overlooked, namely, that of comparative form.
For the purposes of comparing the forms of different grains, they
should be mounted in a medium in which the grain and its various
parts are insoluble. Oil of cedar is such a medium. The variation in
form and size of the aleurone grains when mounted in oil of cedar is
shown in Plate 77a.
The aleurone grains of curcas (Plate 77a, Fig. 1) vary in form from
circular to lens-shaped, and each grain contains one or more
globoids. The globoids are larger when they occur singly. In
sunflower seed (Plate 77a, Fig. 2) the grains vary from reniform to
oval, and one or more globoids are present; many occur in the
center of the grain.
The aleurone grains of flaxseed (Plate 77a, Fig. 3) resemble in
form those of sunflower seed, but the grains are uniformly larger
and some of the grains contain as many as five globoids.
In bitter almond (Plate 77a, Fig. 4) the aleurone grains are mostly
circular, but a few are nearly lens-shaped. A few of the large,
rounded grains contain as many as nine globoids; in such cases one
of the globoids is likely to be larger than the others. The aleurone
grains of croton-oil seed (Plate 77a, Fig. 5) are circular in outline,
variable in form, and each grain contains from one to seven
globoids.
In sesame seed (Plate 77a, Fig. 6) the typical grain is angled in
outline and the large globoid occurs in the narrow or constricted
end.
The aleurone grains of castor-oil seed (Plate 77a, Fig. 7) resemble
those of sesame seed, but they are much larger, and many of the
grains contain three large globoids. When these grains are mounted
in sodium-phosphate solution, the crystalloid becomes visible.
T E S TS F O R A L E U R O N E G R A I N S
Aleurone grains are colored yellow with nitric acid and red with
Millon’s reagent.
The proteid substance of the mass of the grain, of the globoid,
and of the crystalloid, reacts differently with different reagents and
dyes.
The ground substance and the crystalloids are soluble in dilute
alkali, while the globoids are insoluble in dilute alkali.
The ground substance and crystalloids are soluble in sodium
phosphate, while the globoids are insoluble in sodium phosphate.
Calcium oxalate is insoluble in alkali and acetic acid, but it
dissolves in hydrochloric acid.
PLATE 77a
Aleurone Grains
CRYSTALS
M I C R O - C RY S TA L S
Micro-crystals are the smallest of all the crystals. Under the high
power of the microscope they appear as a V, a Y, an X, and as a T.
They are, therefore, three- or four-angled (Plate 78). The thicker
portions of these crystals are the parts usually seen, but when a
close observation of the crystals is made the thin portions of the
crystal connecting the thicker parts may also be observed. Micro-
crystals should be studied with the diaphragm of the microscope
nearly closed and with the high-power objective in position. While
observing the micro-crystals, raise and lower the objective by the
fine adjustment in order to bring out the structure of the crystal
more clearly. Micro-crystals occur in parenchyma cells of belladonna,
scopola, stramonium, and bittersweet leaves; in belladonna, in
horse-nettle root, in scopola rhizome, in bittersweet stems, and in
yellow and red cinchona bark, etc.
The crystals in each of the above parts of the plant are similar in
form, the only observed variation being that of size. Their presence
or absence should always be noted when studying powders.
RAPHIDES
PLATE 78
Micro-Crystals
R O S E TT E C RY S TA L S