Author Archives: RodStephens

About RodStephens

Rod Stephens is a software consultant and author who has written more than 30 books and 250 magazine articles covering C#, Visual Basic, Visual Basic for Applications, Delphi, and Java.

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 , , , , , , , , | Leave a 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

Connect two points with elliptical arcs in C#

As I mentioned in my earlier post Connect two points with arcs of midpoint circles in C#, two points alone cannot uniquely define a circle. An infinite number of circles (or ellipses) can pass through two points and therefore they … Continue reading

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

Connect two points with arcs of midpoint circles in C#

Two points alone cannot uniquely define a circle because an infinite number of circles can pass through two points and therefore they can be connected by an infinite number of arcs. If you add extra information, however, two points can … Continue reading

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

Improve the program that displays COVID-19 data for US states in C#

This post describes two improvements to the earlier example that displays COVID-19 data for US states. The first change is a basic software engineering improvement. The second displays daily changes in COVID-19 case, hospitalization, and death numbers. Software Engineering Notes … Continue reading

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

Use VBA to make a Gantt chart showing work schedules

This example shows how to use VBA (Visual Basic for Applications) in an Excel workbook to draw a Gantt chart showing when employees are scheduled to work. This isn’t C# programming, but you may find it useful. (And I don’t … Continue reading

Posted in Excel, VBA | Tagged , , , , , , , , | Leave a 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

Crop scaled images to specific sizes in C#

This example lets you crop scaled images to specific sizes in C#. The post Crop images to specific sizes in C# lets you drag a rectangle of a specified size around on an image to pick the part of the … Continue reading

Posted in drawing, graphics, image processing, tools | Tagged , , , , , , , , , , , | 2 Comments

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