Math::...Islands(3pm)
π Math::...Islands π
okay bestie, sit DOWN, because we're talking about Math::PlanePath::QuadricIslands β quadric curve rings, and honestly? it's giving concentric island realness ποΈβ¨
πΈ NAME πΈ
Math::PlanePath::QuadricIslands β quadric curve rings π
β¨ SYNOPSIS β¨
use Math::PlanePath::QuadricIslands;
my $path = Math::PlanePath::QuadricIslands->new;
my ($x, $y) = $path->n_to_xy (123);
that's it. that's the whole vibe. you make a path, you ask it for coordinates, slay π
π¦ DESCRIPTION π¦
so this path is literally concentric islands β each one built from four sides, and every side is an eight segment zig-zag (per the "QuadicCurve" path). iykyk π
27--26 3
| |
29--28 25 22--21 2
| | | |
30--31 24--23 20--19 1
| 4--3 |
34--33--32 | 16--17--18 <- Y=0
| 1--2 |
35--36 7---8 15--14 -1
| | |
5---6 9 12--13 -2
| |
10--11 -3
^
-3 -2 -1 X=0 1 2 3 4
the initial figure is the square N=1,2,3,4, and then for the next level every straight side expands to 4x longer and goes zigzag like N=5 through N=13, with the further sides going all the way to N=36. the individual sides? yeah, they're levels of the "QuadricCurve" path. no cap π«Ά
*---*
| |
*---* becomes *---* * *---*
| |
*---*
* <------ *
| ^
| |
| |
v |
* ------> *
now bestie, tea time β β the name "QuadricIslands" here is a slight mistake. Mandelbrot ("Fractal Geometry of Nature" 1982 page 50) calls any islands initiated from a square "quadric", not just this eight segment expansion. and this curve also shows up (unnamed, rude honestly) in Mandelbrot's "How Long is the Coast of Britain", 1967. π
π Level Ranges π
counting the innermost square as level 0, each ring is:
length = 4 * 8^level many points
Nlevel = 1 + length[0] + ... + length[level-1]
= (4*8^level + 3)/7
Xstart = - 4^level / 2
Ystart = - 4^level / 2
for example the lower partial ring shown above is level 2 starting N=(4*8^2+3)/7=37 at X=-(4^2)/2=-8,Y=-8. math mathing fr fr π₯
the innermost square N=1,2,3,4 sits on 0.5 coordinates β for example N=1 at X=-0.5,Y=-0.5. it's centred on the origin and consistent with the (4^level)/2. points from N=5 onwards are integer X,Y. periodt π
4-------3 Y=+1/2
| |
| o |
|
1-------2 Y=-1/2
X=-1/2 X=+1/2
π FUNCTIONS π
see "FUNCTIONS" in Math::PlanePath for behaviour common to all path classes. the shared lore, if you will πΈ
$path = Math::PlanePath::QuadricIslands->new ()β create and return a new path object. your main character moment starts here β¨
π§ Level Methods π§
($n_lo, $n_hi) = $path->level_to_n_range($level)β return per"Level Ranges"above, which is:
( ( 4 * 8**$level + 3) / 7,
(32 * 8**$level - 4) / 7 )
π SEE ALSO π
Math::PlanePathMath::PlanePath::QuadricCurveMath::PlanePath::KochSnowflakesMath::PlanePath::GosperIslands
the whole friend group, obsessed π«Ά
π HOME PAGE π
<http://user42.tuxfamily.org/math-planepath/index.html>
go click it bestie, it's iconic π₯
β LICENSE β
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Kevin Ryde
this file is part of Math-PlanePath.
Math-PlanePath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Math-PlanePath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with Math-PlanePath. if not, see <http://www.gnu.org/licenses/>. π
ok one lil disclaimer bestie β this isperl v5.32.0, dated2021-01-23, and it's User Contributed Perl Documentation for theMath::...Islands(3pm)page. take care of her, she's a queen ππ β¨
π¦ where this page comes from
- debian bookworm: libmath-planepath-perl 129-1 Β· GPL-3.0-or-later
- debian trixie: libmath-planepath-perl 129-1 Β· GPL-3.0-or-later
- ubuntu jammy: libmath-planepath-perl 129-1 Β· GPL-3.0-or-later
- ubuntu noble: libmath-planepath-perl 129-1 Β· GPL-3.0-or-later
- ubuntu resolute: libmath-planepath-perl 129-1 Β· GPL-3.0-or-later
- ubuntu stonking: libmath-planepath-perl 129-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms