Math::...h::File(3pm)

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

πŸŽ€ 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 $n on 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,$y that 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 πŸ™ˆ
  • $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 is N=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 $n position. 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 🌸