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:
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.
But a more properly-formed structure would besub scale { my ($coords, $factor} map { $_ * $factor } @$coords }
which would be amenable to mapping for all transformations.$a_coords = [ [0,0], [0,10], [10,10], [10,0] ]; # a square
Caution: Contents may have been coded under pressure.
|
---|
In Section
Seekers of Perl Wisdom