Tag Archives: points

Use vectors to manage bouncing balls in C#

This example is similar to the one Use sprites to animate several bouncing balls in C# except it uses vectors to store information about the balls. A vector is a direction represented by X and Y coordinates. For example, the … Continue reading

Posted in algorithms, animation, audio, geometry, graphics, multimedia | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Use a GraphicsPath to determine whether a point lies inside a polygon in C#

The example Determine whether a point is inside a polygon in C# shows a mathematical technique for telling if a point lies inside a polygon. This example uses .NET’s GraphicsPath class to do the same thing. The following PointIsInPolygon method … Continue reading

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

Determine whether a point is inside a polygon in C#

One way to determine whether a point lies within a polygon is to add up the angles between the point and adjacent points on the polygon taken in order. For example, if the point in question is P and points … Continue reading

Posted in algorithms, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , | 15 Comments

Find the convex hull of a set of points in C#

This example shows how to find the convex hull for a set of points. The details are fairly complicated so I’m not going to show them all here, but the basic ideas are relatively straightforward. A convex hull is a … Continue reading

Posted in algorithms, geometry, graphics | Tagged , , , , , , , , , , | 9 Comments