Babylonian spiral: Difference between revisions

Content added Content deleted
(Added Perl)
m (→‎Independent implementation: slices rather than explicit enumerations)
Line 510: Line 510:
my @candidates = |@this.map: -> $test {
my @candidates = |@this.map: -> $test {
next-interval(++$radius) if $radius == $test<x>;
next-interval(++$radius) if $radius == $test<x>;
|((1, 1), (1, -1), (-1, 1), (-1, -1) X«*» ($test<x>, $test<y>), ($test<y>, $test<x>))
|((1, 1), (1, -1), (-1, 1), (-1, -1) X«*» $test<x y>, $test<y x>)
}
}
take @tail = |@candidates.min: { ( Θ - atan2 |.[1,0] ) % τ };
take @tail = |@candidates.min: { ( Θ - atan2 |.[1,0] ) % τ };