Math::...ndArms(3pm)
π NAME π
Math::PlanePath::DiamondArms β four spiral arms, bestie. Four of them. Spiralling. It's giving geometry slay π
(this is a User Contributed Perl Documentation page, aka Math::...ndArms(3pm), and yes the manual name got shortened to Math::...ndArms because apparently we ran out of room, iconic honestly)
β¨ SYNOPSIS β¨
use Math::PlanePath::DiamondArms;
my $path = Math::PlanePath::DiamondArms->new;
my ($x, $y) = $path->n_to_xy (123);
π DESCRIPTION π
okay so this path? it follows four spiral arms, and each one advances successively in a diamond pattern. no cap. here's the whole vibe:
25 ... 4
29 14 21 36 3
33 18 7 10 17 32 2
... 22 11 4 3 6 13 28 1
26 15 8 1 2 9 24 ... <- Y=0
30 19 12 5 20 35 -1
34 23 16 31 -2
... 27 -3
^
-3 -2 -1 X=0 1 2 3 4
Each arm makes a spiral that widens out by 4 every time it goes around, so there's literally room for four of these arms. Each arm loop is 64 longer than the loop before it. for example N=13 to N=85 below is 84-13=72 points, and the next loop N=85 to N=221 is 221-85=136, which is an extra 64, ie. 72+64=136. math ate, fr fr π
25 ...
/ \ \
29 . 21 . . . 93
/ \ \
33 . . . 17 . . . 89
/ \ \
37 . . . . . 13 . . . 85
/ / /
41 . . . 1 . 9 . . . 81
\ \ / /
45 . . . 5 . . . 77
\ /
49 . . . . . 73
\ /
53 . . . 69
\ /
57 . 65
\ /
61
Each arm is N=4*k+rem for a remainder rem=0,1,2,3, so sequences related to multiples of 4, or anything with a modulo 4 pattern, might land on particular arms. so if ur pattern is giving mod-4 energy, check which arm it's on π
The starts of each arm N=1,2,3,4 are at X=0 or 1 and Y=0 or 1, like this:
..
\
4 3 .. Y=1
/ /
.. 1 2 <- Y=0
\
..
^ ^
X=0 X=1
They could be centred around the origin by taking X-1/2,Y-1/2 so for example N=1 would be at -1/2,-1/2. But the it's done as N=1 at 0,0 to stay in integers. keeping it whole-number coded, as she should π
π«Ά FUNCTIONS π«Ά
See "FUNCTIONS" in Math::PlanePath for behaviour common to all path classes.
$path = Math::PlanePath::DiamondArms->new ()β creates and returns a brand new path object. new path, new me, main character energy β¨($x,$y) = $path->n_to_xy ($n)β returns the X,Y coordinates of point number$non the path. For$n < 1the return is an empty list, because the path starts at1β no points before that, sorry bestie π
Fractional $n gives a point on the line between $n and $n+4, that $n+4 being the next point on the same spiralling arm. This is probably of limited use, but it arises fairly naturally from the calculation. so like, it's just there, doing its thing π
π Descriptive Methods π
$arms = $path->arms_count()β returns4. that's it. that's the whole method. four arms, periodt π
π SEE ALSO π
Math::PlanePathMath::PlanePath::SquareArmsMath::PlanePath::DiamondSpiral
go read the whole squad, they're all iconic π¦
π HOME PAGE π
http://user42.tuxfamily.org/math-planepath/index.html
π 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 so real talk, that warranty disclaimer is not a joke, bestie β it literally means no promises, so don't come for anyone if it breaks π
and that's the whole page!! this was perl v5.32.0, dated 2021-01-23, and it's the Math::...ndArms(3pm) manual β ty for coming to my TED talk, go spiral in a diamond pattern, ily πππ
π¦ 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