Anonymous user
Divide a rectangle into a number of unequal triangles: Difference between revisions
Divide a rectangle into a number of unequal triangles (view source)
Revision as of 09:56, 18 December 2021
, 2 years ago→{{header|Python}}: Coordinates.
(New draft task with Python solutions.) |
(→{{header|Python}}: Coordinates.) |
||
Line 14:
=={{header|Python}}==
I thought up two algorithms that are explained in the docstrings of functions `rect_into_tri`and `rect_into_top_tri`.
It is assumed that the rectangle has its bottom left coordinate at (0,0) and is not rotated in the coordinate space, meaning that the location of the top-right corner of the rectangle is then enough to define it.
<lang python>
|