in reply to Plotting A Line
What you are looking for is Bresenhams algorithm for drawing a line. I don't know of an implementation of it for Perl, as most drawing in Perl is done on a higher level by using OpenGL or SVG though. The concept of Bresenhams algorithm is relatively easy - you step down the longer distance and keep a counter for when you have to move one column in the other direction. The fun thing is to understand how and why the algorithm works without requiring floating point math.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Plotting A Line
by Abigail-II (Bishop) on Oct 27, 2003 at 22:11 UTC | |
by boo_radley (Parson) on Oct 28, 2003 at 13:44 UTC |