Skip to content

Conversation

@ilateur
Copy link
Contributor

@ilateur ilateur commented Mar 27, 2025

Adds triangle Shape, which asks for 6 float64 numbers, which represent the 3 2D vertices (x0, y0), (x1, y1) and (x2, y2). Using barycentric coordinates, the Shape returns true if the given (x, y, z) coordinate is inside of the triangle, regardless of the levorotation.

This will divide by 0 if the triangle has no area, but why would you define such a triangle.

@ilateur ilateur requested a review from JonathanMaes March 27, 2025 16:34
@ilateur ilateur self-assigned this Mar 27, 2025
Copy link
Contributor

@JonathanMaes JonathanMaes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check for the divide by zero issue.

@ilateur ilateur merged commit ac0d049 into 3.11 Apr 2, 2025
@ilateur ilateur deleted the feature/triangle branch April 2, 2025 10:40
@JonathanMaes JonathanMaes mentioned this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants