Skip to content

Instantly share code, notes, and snippets.

@squeakyspacebar
squeakyspacebar / triangleisccw.cs
Last active September 3, 2025 17:24
Triangle Is Counterclockwise
// Determines whether or not a set of three points is in counter-clockwise order.
private bool TriangleIsCCW(Vector2f a, Vector2f b, Vector2f c) {
float det = ((a.x - c.x) * (b.y - c.y)) - ((a.y - c.y) * (b.x - c.x));
return (det > 0);
}