PETZOLD BOOK BLOG

Charles Petzold on writing books, reading books, and exercising the internal UTM


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

Squaring the Circle

April 22, 2006
A rainy New York City Saturday

Oh, well, another millennia-old geometry problem solved with a few lines of XAML.

But seriously, folks, this program shows how the individual end points and control points of Bézier curves can be animated. A circle is approximated with four Bézier curves. (See pages 629-632 of Programming Windows with C# for details on the technique.) The 13 points are animated between the circle values and those necessary to define a square approximately equal in area. For the four sides of the square, the Béziers collapse into straight lines when the two control points lie on the straight line between the two end points.


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

(c) Copyright Charles Petzold
www.charlespetzold.com