Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2018-03-22 16:33 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (279 votes). Check out past polls.