NAME

Transform::Canvas - Perl extension for blah blah blah

SYNOPSIS

use Transform::Canvas;
$t = Transform::Canvas->new(canvas=>[10,10,100,100],data=>[-100,-100,100,100]);
$r_x = [-100,-10, 0, 20, 40, 60, 80, 100];
$r_y = [-100,-10, 0, 20, 40, 60, 80, 100];
($pr_x,$pr_y) = $t->map($r_x,$r_y);

DESCRIPTION

Stub documentation for Transform::Canvas, created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited.

Blah blah blah.

EXPORT

None by default.

sub new (canvas => [x0 y0 x1 y1], data=>[x0 y0 x1 y1])

generate the conversion object through which all data points will be passed. NB: svg drawings use the painter's model and use a coordinate system which starts at the top, left corner of the document and has x-axis increasing to the right and y-axis increasing down.

The y-axis is inverted compared to mathematical representation systems which prefer y to increase up.

canvas:
       x0 = paper-space minimum x value
       y0 = paper-space maximum x value
       x1 = paper-space minimum y value
       y1 = paper-space maximum y value
data:
       x0 = data-space minimum x value
       y0 = data--space maximum x value
       x1 = data-space minimum y value
       y1 = data-space maximum y value

sub initialize

nothing to see. it's all over. move along.

prepareMap

prepare the transformation space for the conversions; Currently only handles linear transformations, but this is a perfect candidate for non-spacial transforms... Maybe Kake or Jo have ideas...

i wish i had my math texts with me and i was not on a train for this...

map($x,$y)

Map an array or a value of the x,y data axes to the x,y canvas axes

mapX

Map an array or a value of the x data axis to the x canvas axis

mapY

Map an array or a value of the y data axis to the y canvas axis

SEE ALSO

SVG SVG::Parser SVG::DOM SVG::Element SVG::Graph SVG::Extension

AUTHOR

Ronan Oger, <ronan@roasp.com<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Ronan Oger

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.