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

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://505135]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2018-07-20 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (435 votes). Check out past polls.

    Notices?