Math::PlanePath::File(3pm) | User Contributed Perl Documentation | Math::PlanePath::File(3pm) |
Math::PlanePath::File -- points from a file
use Math::PlanePath::File; my $path = Math::PlanePath::File->new (filename => 'foo.txt'); my ($x, $y) = $path->n_to_xy (123);
This path reads X,Y points from a file to present in PlanePath style. It's slightly preliminary yet but is handy to get numbers from elsewhere into a PlanePath program.
The intention is to be flexible about the file format and to auto-detect as far as possible. Currently the only format is plain text, with an X,Y pair, or 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. Lines not starting with a number are ignored as comments (or blanks). N values must be integers, but the X,Y values can be fractions like 1.5 too, including exponential floating point 1500.5e-1 etc.
See "FUNCTIONS" in Math::PlanePath for behaviour common to all path classes.
In the current code an "$x,$y" within a unit circle or square of a point from the file gives that point. But perhaps in the future some attention could be paid to apparent spacing of points closer than that.
Math::PlanePath
<http://user42.tuxfamily.org/math-planepath/index.html>
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 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/>.
2021-01-23 | perl v5.32.0 |