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 16:53, 28 January 2022
, 2 years ago→{{header|Raku}}: add similarity check
(→{{header|Raku}}: moving the goalposts: now use a descending sequence to tell the triangles apart) |
m (→{{header|Raku}}: add similarity check) |
||
Line 480:
sub UnequalDivider (\L,\H,\N where N > 2) {
my \sum = $ =
loop { # if ▲OHA ~ ▲OEL
sum = @sequence.sum; # increase 1st term
@sequence[0]*L*L/sum == H*H ?? (@sequence[0] +=1) !! last
}
( [ (0,0), (L,H), (L,0) ], ).Array.append: @sequence.map: -> \chunk {
|