Tag Archives: algorithms

Draw words on a circle in WPF and C#

This example shows one way that you can draw words on a circle in WPF. Note that it does not show how to draw words where each character is rotated to follow the circle’s curve. Each word is rotated as … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | Leave a comment

Draw a hyperbolic spiral in C#

A hyperbolic spiral, which is also called an reciprocal spiral, is the inverse of an Archimedes spiral. It uses the equation r = A / θ to generate points on a spiral. This spiral has a couple of interesting properties. … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | Leave a comment

Draw a logarithmic spiral in C#

The post Draw an Archimedes spiral in C# uses the equation r = A˙θ to generate the points on a spiral. This example is almost exactly the same except it uses the equation to r = A˙eB˙θ to generate its … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | Leave a comment

Draw a filled spiral in C#

My post Draw an Archimedes spiral in C# explained how to draw multiple Archimedes spirals starting at a common center point. This post shows how you can fill the spaces between the spirals with colors. The basic idea is to … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , , | 2 Comments

New Book: The Modern C# Challenge

My latest book, The Modern C# Challenge, is now available. It’s a collection of 100 programming challenges that let you test your ability in a wide variety of programming topics, many of which are not usually covered in traditional programming … Continue reading

Posted in algorithms, books, files, mathematics, puzzles | Tagged , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Draw an Archimedes spiral in C#

An archimedes spiral is defined by the polar coordinate equation r = A * θ. It’s just as simple as that, and this would be a significantly shorter post except for one question: how do you know how big you … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | 2 Comments

Tile a board with colored trominoes in C#

The post Tile a board with trominoes in C# explains how to tile a board with a missing square with trominoes. This post shows how to color the trominoes so no two adjacent ones share the same color. The four-color … Continue reading

Posted in algorithms, drawing, graphics, mathematics, recursion | Tagged , , , , , , , , , , , , , , , , , , | 1 Comment

Tile a board with trominoes in C#

Trominoes are polyominoes of order three. That means they are polygons made up of three equal sized squares joined at their edges. There only are two kinds of trominoes: three squares joined in a line and three squares joined in … Continue reading

Posted in algorithms, drawing, graphics, mathematics, recursion | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Find a Ducci sequence in C#

A Ducci sequence is a sequence of tuples of integers. You start with a sequence of values such as 1-2-3-4-5. TO find the next tuple, you calculate the absolute value of the difference between adjacent numbers in the sequence, wrapping … Continue reading

Posted in algorithms, mathematics | Tagged , , , , , , , , , | Leave a comment

Graph points in WPF and C#

This example extends the previous example Draw a graph in WPF and C# to draw ellipses marking the data sets’ points. See that example for an explanation of how most of the program works. The following code shows how the … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment