10/12/18

Today's Breakfast of Champions



Coffee: San Francisco Bay French Roast beans (Costco)

Adulterated with:
  1. Kirkland Organic Virgin Coconut Oil
  2. Kerrygold Pure Irish Butter (unsalted)
  3. Richi Turmeric Ginger Chai
Grub: homemade chocolate chip cookie (thanks Margaret)

For Team Purple

 A friend who had pancreatic cancer (and has since passed away) created a campaign to raise awareness and research funds called Purple Stride. I wasn't able to make the walk so I let her know I was thinking of her ...



10/3/18

The Beauty In Numbers, 1a: Plotting a circle.


Let's use math to draw pictures, shall we? There is a wonderful world out there of representing patterns in nature, especially flowers, in mathematical terms. Ever gazed into a sunflower? I hope so. I'm learning and exploring as I go along here, so I'll start with simple circle plots and move on from there. But where to start?  How about Pythagorus?

Although it is often argued that knowledge of the theorem predates him, the theorem is named after the ancient Greek mathematician Pythagoras (c. 570–495 BC) as it is he who, by tradition, is credited with its first proof, although no evidence of it exists. There is some evidence that Babylonian mathematicians understood the formula, although little of it indicates an application within a mathematical framework. Mesopotamian, Indian and Chinese mathematicians all discovered the theorem independently and, in some cases, provided proofs for special cases. (Wikipedia)

The Pythagorean theorem is a wondrous thing, having to do with the relationship among the three sides of a right triangle. The theorem states that the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides. It can be written as an equation relating the lengths of the sides a, b and c, :

where c represents the length of the hypotenuse and a and b the lengths of the triangle's other two sides.

But how do we turn this into compelling pictures? We can do a lot with this if we use software programs to draw or plot, say, circles. A lot of beautiful geometric patterns come out of circles, including patterns that represent the arrangement of petals and stems in flowers. But how do we get circles out of these triangles? By expressing the Pythagorean theorem in terms of trigonometric functions.




We need to move to trigonometry because we need to move beyond solving triangles. Trigonometry give use a mathematical description of our physical world, of things that rotate or vibrate, such as light, sound, the paths of planets about the sun or satellites about the earth. We have to have angles of any size, and to extend to them the meanings of the trigonometric functions.


The Pythagorean trigonometric identity states that sin²(θ) + cos²(θ) = 1 for any real number θ. Since every (x, y) point should be in the unit circle (a circle with a radius of 1), it follows that x² + y² = 1.

Okay. Now that we've established the background information, we can begin building a series of plots. We start by creating a dataset of two variables, x and y. First, we'll draw 50 points on a circle of radius 1. 

In R, some code for drawing (plotting) 50 points in a circle looks like this:

t = seq(0, 2*pi, length.out=50)
x = sin(t)
y = cos(t)
df = data.frame(t, x, y)

# Make a scatter plot of points in a circle
ggplot(df)

Running this code results in this:



Very basic, yes? But with various enhancements and tweaks to the code, we can begin to get images that look like the geometry seen in flowers.

Thanks to @aschinchon

10/1/18

Hello, you gorgeous algorithm you.

Can there be beauty in math?  I think so. I want to experiment with this idea for awhile. So, here goes a new series: The Beauty In Numbers. I'm going to off on a tangent (!) and study mathematics and art together.
Algorithmic Beauty in Plants

Mathematics, rightly viewed, possesses not only truth, but supreme beauty—a beauty cold and austere, like that of sculpture, without appeal to any part of our weaker nature, without the gorgeous trappings of painting or music, yet sublimely pure, and capable of a stern perfection such as only the greatest art can show. The true spirit of delight, the exaltation, the sense of being more than Man, which is the touchstone of the highest excellence, is to be found in mathematics as surely as poetry. (Bertrand Russel)

Why are numbers beautiful? It's like asking why is Beethoven's Ninth Symphony beautiful. If you don't see why, someone can't tell you. I know numbers are beautiful. If they aren't beautiful, nothing is. (Paul Erdős)