Math::...ePathN(3pm)

πŸ“¦
version 129 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 $i in the PlanePath. $i is 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 $value actually shows up in the sequence. what that means, bestie: $value is 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::NumSeq
  • Math::NumSeq::PlanePathCoord
  • Math::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. πŸ’…πŸ’–βœ¨