Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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
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 browsing the Monastery: (7)
As of 2020-06-03 13:22 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (23 votes). Check out past polls.