Math::...h::File(3pm)
π NAME π
Math::PlanePath::File β points from a file π
(this is the perl manual page for Math::PlanePath::File(3pm), and yes the title line got squished by the terminal, she's just a long name, she's fine)
β¨ SYNOPSIS β¨
use Math::PlanePath::File;
my $path = Math::PlanePath::File->new (filename => 'foo.txt');
my ($x, $y) = $path->n_to_xy (123);
π¦ DESCRIPTION π¦
okay so basically this path reads X,Y points out of a file and serves them up in PlanePath style. She's slightly preliminary still ngl, but she is so handy when you wanna get numbers from literally anywhere else into a PlanePath program. π
The whole intention is being flexible about the file format and auto-detecting as far as she possibly can. Right now the only format is plain text, with an X,Y pair, or an N,X,Y triplet, on each line π
5,6 # X,Y
123 5 6 # N,X,Y
Numbers can be separated by a comma, or just spaces and tabs, whatever feels right. Lines that don't start with a number get ignored as comments (or blanks) β she just skips them, no drama π. The N values must be integers, but the X,Y values can be fractions like 1.5 too, including exponential floating point like 1500.5e-1 etc. periodt π
π FUNCTIONS π
Go check out "FUNCTIONS" in Math::PlanePath for the behaviour that's common to all the path classes, bestie π«Ά
$path = Math::PlanePath::File->new (filename => "/my/file/name.txt")β creates you a shiny new path object and hands it right over β¨($x,$y) = $path->n_to_xy ($n)β gives you back the X,Y coordinates of point number$non the path.$n = $path->xy_to_n ($x,$y)β gives you the point number for coordinates$x,$y.- lowkey important: in the current code, an
$x,$ythat lands inside a unit circle or square of a point from the file gives you that point. But maybe someday someone will pay attention to the apparent spacing of points that are closer together than that. Not today tho π
- lowkey important: in the current code, an
$bool = $path->x_negative()$bool = $path->y_negative()β returns true if there are any negative X or negative Y coordinates in the file.$n = $path->n_start()β returns the first N in the path. For files of just X,Y points the start isN=1; for N,X,Y data it's the first N.$str = $path->figure()β returns a string name of the figure (shape) that's meant to be drawn at each$nposition. In the current code, if all the X,Y are integers then it's"square", otherwise it's"circle". But maybe that'll change π§
π SEE ALSO π
Math::PlanePath
π 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're welcome to 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 (if you'd rather) 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/>.
okay that's the whole page bestie, we ate and left zero crumbs π
this was the manual page for Math::...h::File(3pm), built from perl v5.32.0, dated 2021-01-23 β mwah, go read a file πΈ
π¦ 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