Category Archives: mathematics

WPF 3d: Table of Contents

This is a brief summary of the table of contents for my book WPF 3D, Three-Dimensional Graphics with WPF and C#. Contents Introduction Part I. Getting Started Chapter 1. XAML Example Chapter 2. C# Example Chapter 3. Coordinates Chapter 4. … Continue reading

Posted in 3D, 3D graphics, algorithms, books, drawing, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , | 3 Comments

Graph a square curve in C#

This example shows how to graph a curve that draws a square. The basic idea isn’t as bizarre as you might think. You probably know that x2 + y2 = 1 is the equation for a circle. So what is … Continue reading

Posted in algorithms, drawing, mathematics | Tagged , , , , , , , , , , , | 4 Comments

Graph a curve in polar coordinates in C#

In Cartesian coordinates, a point is specified by X and Y values. In polar coordinates, a point is specified by r and θ where: r is the point’s radial distance from the origin θ is the angle that gives the … Continue reading

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

Compare floating-point values safely in C#

The computer stores values, including floating-point values, in binary using 0s and 1s. That means it cannot store all possible decimal values exactly. Sometimes when you multiply or divide two floating-point values, the computer is unable to store the result … Continue reading

Posted in calculations, mathematics | Tagged , , , , , , , , , , , , , | 3 Comments

Calculate credit payments in WPF and C#

This is a WPF version of the example Calculate credit payments in C#. The calculations are the same. Unfortunately building and using the user interface is much harder in WPF, particularly working with the ListView control. (The unofficial WPF slogan: … Continue reading

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

Display tooltips on a graph of an equation entered by the user in C#

This example draws a graph of an equation entered by the user and the displays a tooltip on it when you move the mouse over the graph. See the post Graph equations entered by the user in C# for information … Continue reading

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

Use branch and bound to find the highest value path through a two-dimensional array of numbers in C#

This method is similar to path-finding methods described in my books Essential Algorithms: A Practical Approach to Computer Algorithms and Interview Puzzles Dissected, Solving and Understanding Interview Puzzles. Follow those links for more information including tables of contents. The example … Continue reading

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

Find the highest value path through a two-dimensional array of numbers in C#

This method is similar to path-finding methods described in my books Essential Algorithms: A Practical Approach to Computer Algorithms and Interview Puzzles Dissected, Solving and Understanding Interview Puzzles. Follow those links for more information including tables of contents. Look at … Continue reading

Posted in algorithms, mathematics | Tagged , , , , , , , , , | 1 Comment

Draw a Fibonacci word fractal in C#

This example uses the Fibonacci word to draw a fractal curve. For information on the Fibonacci word, see the post Calculate Fibonacci words in C#. To draw a curve with level N, use Fibonacci word number N. Loop through the … Continue reading

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

Calculate Fibonacci words in C#

You can find Fibonacci words by concatenating previous Fibonacci words much as you calculate the Fibonacci sequence by adding previous values in the sequence. The first two Fibonacci words are: S0 = 0 S1 = 01 The following Fibonacci words … Continue reading

Posted in algorithms, fractals, graphics, mathematics | Tagged , , , , , , , , , , , | 1 Comment