Tag Archives: algorithms

Fill a target area found by trilateration in C#

The post Perform trilateration in C# explains how a C# program can use trilateration to find an area where a target point lies. This post explains how you can draw that area. The Target Area The target area found by … Continue reading

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

Perform trilateration in C#

This post explains how a C# program can use trilateration to locate a point that is known distances from three other points. Trilateration is somewhat similar to triangulation, so following two sections begin by explaining what triangulation and trilateration are. … Continue reading

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

Draw many circles that intersect two points in C#

As I mentioned in my earlier post Connect two points with elliptical arcs in C#, an infinite number of circles (or ellipses) can pass through two points. This example draws some of them to produce an interesting pattern. This example … Continue reading

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

Create a Contain FillMode for filling polygons in C#

The example Understand fill modes in C# showed how the Alternate and Winding FillMode values affect the result when you fill a self-intersecting polygon. In many cases, the Alternate FillMode leaves holes in a self-intersecting polygon while the Winding FillMode … Continue reading

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

Find the angle between two vectors in C#

This example shows how you can find the angle between two vectors. The program has three main parts: selecting the points that define the vectors, drawing the vectors, and calculating the angle between them. The last task is the most … Continue reading

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

Create a schedule for a round robin tournament with home teams in C#

My book Essential Algorithms, Second Edition describes an algorithm for creating a round robin schedule in detail. The following posts also explain how you can create a round robin schedule in slightly less detail. Generate a schedule for a round … Continue reading

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

Understand bitwise operators in C#

The examples Make an efficient priority queue class in C#, Part 1 and Make an efficient priority queue class in C#, Part 2 explain how to make a heap-based priority queue. Those examples use a FindMsb method that uses bitwise … Continue reading

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

Build a Windows process tree in C#

A process tree is a tree that shows the processes running on the computer arranged hierarchically so you can see which processes started other processes. My first attempts at this used techniques that I found scattered around the internet. Unfortunately … Continue reading

Posted in algorithms, system | Tagged , , , , , , , , , | 5 Comments

Animate maze solving, version 3

The previous maze-solving examples Animate maze solving, version 1 and Animate maze solving, version 2 used a recursive method named Solve that returns an IEnumerable containing the paths that the program was searching. Removing Recursion To remove the recursion, think … Continue reading

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

Animate maze solving, version 2

My earlier post Animate maze solving, version 1 uses a method that returns an enumeration to show the steps used to find a path through a maze. That method works but it uses a loop that includes calls to Thread.Sleep … Continue reading

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