Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: two-dimensional coordinate transformation

by Roy Johnson (Monsignor)
on Nov 02, 2005 at 22:06 UTC ( #505135=note: print w/replies, xml ) Need Help??

in reply to two-dimensional coordinate transformation

Each of them would be a map, except you want it to take them two-by-two. Scale is the easiest, since you don't have to worry about that:
sub scale { my ($coords, $factor} map { $_ * $factor } @$coords }
But a more properly-formed structure would be
$a_coords = [ [0,0], [0,10], [10,10], [10,0] ]; # a square
which would be amenable to mapping for all transformations. I think this is a do-it-yourself project, but wouldn't be too surprised to be surprised. :-) Check out Math::Polygon for something in the right ballpark.

Caution: Contents may have been coded under pressure.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://505135]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2023-02-02 11:41 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (17 votes). Check out past polls.