Skip to content

Instantly share code, notes, and snippets.

@steveruizok
Last active February 28, 2021 11:15
Show Gist options
  • Save steveruizok/0a16d7d4457ab32cb2cdc597159103e5 to your computer and use it in GitHub Desktop.
Save steveruizok/0a16d7d4457ab32cb2cdc597159103e5 to your computer and use it in GitHub Desktop.
Get whether points A and B are clockwise, relative to a point C.
function pointsAreClockwise(A: number[], B: number[], C: number[]) {
return (B[0] - A[0]) * (C[1] - A[1]) - (C[0] - A[0]) * (B[1] - A[1]) > 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment