Ada Lovelace Day: Mary Everest Boole and Beautiful Math

October 16th, 2012 is technically Ada Lovelace Day, a day for celebrating women in science, technology, engineering, and math (STEM), but as long as it's October 16th *somewhere* you can celebrate the day.  Ada Lovelace is known as the first computer programmer, and possibly the first person to have a code review, finding bugs in Charles Babbage's code:

So also was the algebraic working out of the different problems, except, indeed, that relating to the numbers of Bernoulli, which I had offered to do to save Lady Lovelace the trouble. This she sent back to me for an amendment, having detected a grave mistake which I had made in the process.

-- Charles Babbage in his Passages from the Life of a Philosopher 

I can only hope Ada's letter started out in the traditional code review lexicon "WTF Charles!?"

Though as a programmer Ada's impact on me is great, I'd have to say Mary Everest Boole had an earlier impact on my, though I didn't know it was her at the time.  In 5th grade I was shown a method of creating line art with algebra, commonly known as curve stitching or string art.  It's an unfortunate label, as it hides the fact its really a method for constructing quadratic Bézier curves.

The process is simple.  Draw to lines connected at one point, and then draw a series of lines connecting two lines offsetting a little bit each time.  Here is a video of the process:

As someone who has never been talented at graphic design and art I loved filling notebooks with curve stich designs.  Mostly faces, spaceships, and futuristic landscapes.  You can really get interesting patterns as you vary the line lengths, angles, or use arcs in place of the lines.

Curve stitching was invented by Mary Boole (yes, wife of that Boole) as a way to engage children in mathematics.   Mary actually spent quite a bit of time working on ways to improve mathematical education by making it more approachable.  Some of her books like the Philosophy and Fun of Algebra and The Preparation of the Child for Science are still around, though searching it looks like many may have been lost to time.  That's unfortunate, because getting children interested in mathematics is a problem we have yet to solve over 100 years later.

A few years ago, in one of those odd moments when you start a new program just to works something out, I created a little WPF app that does curve stitching.  It's basic, and I've not touched it since, but all the user has to do is click three points on the screen to render a pattern.  Repeat as often as you like and press escape to clear the screen.  You can get the code in my Google Code project.

LA-Ship

The code to draw a curve stich is pretty simple.  The method below takes in the 3 points that define the two lines, the number of lines to draw connecting them, and a WPF Canvas object to render them on.

public void DrawLineArt(Point start, Point center, Point end, Int32 steps, Canvas graph) {
    Line source = new Line() { X1 = center.X, Y1 = center.Y, X2 = start.X, Y2 = start.Y, Stroke = Brushes.Black, StrokeThickness = 1 };
    Line target = new Line() { X1 = center.X, Y1 = center.Y, X2 = end.X, Y2 = end.Y, Stroke = Brushes.Black, StrokeThickness = 1 };

    graph.Children.Add(source);
    graph.Children.Add(target);

    for (Int32 i = 1; i <= steps; i++) {
        Line connection = new Line() { Stroke = Brushes.Black, StrokeThickness = 1 };
        connection.X1 = source.X1 + (source.X2 - source.X1) / (Double)steps * i;
        connection.Y1 = source.Y1 + (source.Y2 - source.Y1) / (Double)steps * i;
        connection.X2 = target.X1 + (target.X2 - target.X1) / (Double)steps * ((Double)steps - i);
        connection.Y2 = target.Y1 + (target.Y2 - target.Y1) / (Double)steps * ((Double)steps - i);
        graph.Children.Add(connection);
    }
}

I've toyed around with ideas to make a game using only this style of line art for the graphics.  It's a shame we no longer have vector rendering CRTs as we did in the days of Tempest.  I think the part of this game that appeals most to me wouldn't be the game itself, but making the modeling program for creating the game assets!

Can't you just see this guy as a boss battle?

LA-Face

Posted By Mike On Monday, October 15, 2012
Filed under wpf games math | No Comments

Submit this story to DotNetKicks   

Leave a comment



Your name:
 

Your email (not shown):
 
Will display your Gravatar image.

Your website (optional):



About Michael

Michael C. Neel, born 1976 in Houston, TX and now live in Knoxvile, TN. Software developer, currently .Net focused. Board member of ETNUG and organizes CodeStock, East Tennessee's annual developers conference. .Net speaker, a Microsoft ASP.NET MVP and ASPInsider. Co-Founder of FuncWorks, LLC and GameMarx.

Proud father of two amazing girls, Rachel and Hannah, and loving husband to Cicelie who inflates and pops his ego as necessary.

 Subscribe to ViNull.com |  Comments

Follow me on Twitter | Contact Me

Related Posts

SilverLight 2.0: Setting the Background of a Button

I know, this hardly seems a topic worthy of a blog post.  To create a Button in SilverLight like the first in the picture is just: <Button Content="Stock ... Read more

Code Camp Room Planner

I just finished creating a project on CodePlex for the Code Camp Room Planner, a little app I wrote to help me plan the schedule at CodeStock 2009.  ... Read more

WPF: Using Viewbox and Canvas to create a virtual resolution workspace

First, for you SilverLight 2.0 junkies, you can skip over this.  SilverLight 2.0 doesn't (yet?) support the WPF ViewBox. The problem: when you start ... Read more

WPF: Threading basics in WPF

In my previous WPF post I created a simple photo viewer.  If you run the application, you'll notice things "lock up" while downloading an image.  ... Read more

WPF: Dive into WPF

For this first post on WPF I've decided it would be best to start off with a "real" application.  This means we'll need those thing almost all applications ... Read more

XNA 3D Primer by Michael C. Neel

XNA 3D Primer by Michael C. Neel
Buy Now: [ Amazon ] [ Wrox ]

GameMarx

CodeStock

ASPInsiders Member

ETNUG Member