1Math::NumSeq::PlanePathUNs(e3r)Contributed Perl DocumentMaattiho:n:NumSeq::PlanePathN(3)
2
3
4
6 Math::NumSeq::PlanePathN -- sequence of N values from PlanePath module
7
9 use Math::NumSeq::PlanePathN;
10 my $seq = Math::NumSeq::PlanePathN->new (planepath => 'SquareSpiral',
11 line_type => 'X_axis');
12 my ($i, $value) = $seq->next;
13
15 This module presents N values from a "Math::PlanePath" as a sequence.
16 The default is the X axis, or the "line_type" parameter (a string) can
17 choose among
18
19 "X_axis" X axis
20 "Y_axis" Y axis
21 "X_neg" X negative axis
22 "Y_neg" Y negative axis
23 "Diagonal" leading diagonal X=i, Y=i
24 "Diagonal_NW" north-west diagonal X=-i, Y=i
25 "Diagonal_SW" south-west diagonal X=-i, Y=-i
26 "Diagonal_SE" south-east diagonal X=i, Y=-i
27 "Depth_start" first N at depth=i
28 "Depth_end" last N at depth=i
29
30 For example the "SquareSpiral" X axis starts i=0 with values 1, 2, 11,
31 28, 53, 86, etc.
32
33 "X_neg", "Y_neg", "Diagonal_NW", etc, on paths which don't traverse
34 negative X or Y have just a single value from X=0,Y=0.
35
36 The behaviour on paths which visit only some of the points on the
37 respective axis is unspecified as yet, as is behaviour on paths with
38 repeat points, such as the "DragonCurve".
39
41 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
42 classes.
43
44 "$seq = Math::NumSeq::PlanePathN->new (key=>value,...)"
45 Create and return a new sequence object. The options are
46
47 planepath string, name of a PlanePath module
48 planepath_object PlanePath object
49 line_type string, as described above
50
51 "planepath" can be either the module part such as "SquareSpiral" or
52 a full class name "Math::PlanePath::SquareSpiral".
53
54 "$value = $seq->ith($i)"
55 Return the N value at $i in the PlanePath. $i gives a position on
56 the respective "line_type", so the X,Y to lookup a "$value=N" is
57
58 X,Y line_type
59 ----- ---------
60 $i, 0 "X_axis"
61 0, $i "Y_axis"
62 -$i, 0 "X_neg"
63 0, -$i "Y_neg"
64 $i, $i "Diagonal"
65 $i, -$i "Diagonal_NW"
66 -$i, -$i "Diagonal_SW"
67 $i, -$i "Diagonal_SE"
68
69 "$bool = $seq->pred($value)"
70 Return true if $value occurs in the sequence.
71
72 This means $value is an integer N which is on the respective
73 "line_type", ie. that "($path->n_to_xy($value)" is on the line
74 type.
75
77 Math::NumSeq, Math::NumSeq::PlanePathCoord,
78 Math::NumSeq::PlanePathDelta
79
81 <http://user42.tuxfamily.org/math-planepath/index.html>
82
84 Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Kevin
85 Ryde
86
87 This file is part of Math-PlanePath.
88
89 Math-PlanePath is free software; you can redistribute it and/or modify
90 it under the terms of the GNU General Public License as published by
91 the Free Software Foundation; either version 3, or (at your option) any
92 later version.
93
94 Math-PlanePath is distributed in the hope that it will be useful, but
95 WITHOUT ANY WARRANTY; without even the implied warranty of
96 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
97 General Public License for more details.
98
99 You should have received a copy of the GNU General Public License along
100 with Math-PlanePath. If not, see <http://www.gnu.org/licenses/>.
101
102
103
104perl v5.32.0 2020-07-28 Math::NumSeq::PlanePathN(3)