Math::...ePathN(3pm)
π Math::NumSeq::PlanePathN π
okay so bestie, welcome to Math::NumSeq::PlanePathN(3pm) β it lives in the User Contributed Perl Documentation section and it's literally here to hand you a whole sequence of N values pulled straight out of a Math::PlanePath module. iykyk. β¨
NAME β¨
Math::NumSeq::PlanePathN β a sequence of N values straight from a PlanePath module. that's it, that's the whole vibe π¦
SYNOPSIS πΈ
use Math::NumSeq::PlanePathN;
my $seq = Math::NumSeq::PlanePathN->new (planepath => 'SquareSpiral',
line_type => 'X_axis');
my ($i, $value) = $seq->next;
DESCRIPTION π
So the whole point of this module is: it takes a Math::PlanePath and serves you up N values as a sequence. iconic behaviour honestly.
By default it walks the X axis, but you can pass a line_type parameter (a string, bestie) to pick a different line, like:
"X_axis" X axis (positive part)
"Y_axis" Y axis (positive part)
"X_neg" X negative axis
"Y_neg" Y negative axis
"Diagonal" leading diagonal X=i, Y=i
"Diagonal_NW" north-west diagonal X=-i, Y=i
"Diagonal_SW" south-west diagonal X=-i, Y=-i
"Diagonal_SE" south-east diagonal X=i, Y=-i
"Depth_start" first N at depth=i
"Depth_end" last N at depth=i
fr fr, example time: the "SquareSpiral" X axis kicks off at i=0 with values 1, 2, 11, 28, 53, 86, etc. slay. π₯
And like, "X_neg", "Y_neg", "Diagonal_NW", etc β on paths that don't traverse negative X or Y, you just get a single value, coming from X=0,Y=0. one (1) value. no more. π
β οΈ lowkey important: the behaviour on paths that only visit some of the points on the respective axis is unspecified as yet, and so is the behaviour on paths with repeat points, like the "DragonCurve". we said what we said. π
FUNCTIONS π«Ά
heads up β go peep "FUNCTIONS" in Math::NumSeq for the behaviour that's common to all the sequence classes. π
$seq = Math::NumSeq::PlanePathN->new (key=>value,...)β makes you a shiny new sequence object and returns it. the options are:
planepath string, name of a PlanePath module
planepath_object PlanePath object
line_type string, as described above
and like, "planepath" can be either just the module part (think "SquareSpiral") or the whole full class name (think "Math::PlanePath::SquareSpiral"). either one eats. π
$value = $seq->ith($i)β returns the N value at$iin the PlanePath.$iis a position on whichever"line_type"you picked, so the X,Y you look up to find"$value=N"is:
X,Y line_type
----- ---------
$i, 0 "X_axis"
0, $i "Y_axis"
-$i, 0 "X_neg"
0, -$i "Y_neg"
$i, $i "Diagonal"
$i, -$i "Diagonal_NW"
-$i, -$i "Diagonal_SW"
$i, -$i "Diagonal_SE"
$bool = $seq->pred($value)β returns true if$valueactually shows up in the sequence. what that means, bestie:$valueis an integer N that's sitting on the respective"line_type", i.e. that"($path->n_to_xy($value)"lands on the line type. cute. β¨
SEE ALSO π
Math::NumSeqMath::NumSeq::PlanePathCoordMath::NumSeq::PlanePathDelta
HOME PAGE πΈ
<http://user42.tuxfamily.org/math-planepath/index.html> π¦
LICENSE π
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 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/>.
and that's a wrap bestie!! this whole thing came to you via perl v5.32.0, dated 2021-01-23, and it's the Math::...ePathN(3pm) page in the User Contributed Perl Documentation. periodt. π
πβ¨
π¦ 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