XP is just a number PerlMonks

### Polygon Filling algorithm in Perl

by rbc (Curate)
 on Sep 27, 2002 at 21:52 UTC Need Help??

Replies are listed 'Best First'.
Re: Polygon Filling algorithm in Perl
by hossman (Prior) on Sep 28, 2002 at 08:55 UTC

totally random thought...

I notice you defined all of your y coords based on the height .. but you used subtraction, so you're still making an assumption about the minimum height. Any time you can define some constraint on a value given another value, you should consider doing so in your code. That way if someone says "Hey this is cool, but it's a little big so i'll change the size to 50x60" your code can deal with the change flawlessly...

```my \$A = new Vector2D( int(\$width * 0.3125),  int(\$height * 0.65) );
my \$B = new Vector2D( int(\$width * 0.46875), int(\$height * 0.75) );
my \$C = new Vector2D( int(\$width * 0.65625), int(\$height * 0.55) );
my \$D = new Vector2D( int(\$width * 0.65625), int(\$height * 0.25) );
my \$E = new Vector2D( int(\$width * 0.46875), int(\$height * 0.45) );
my \$F = new Vector2D( int(\$width * 0.3125),  int(\$height * 0.35) );

Create A New User
Node Status?
node history
Node Type: perlcraft [id://201359]
Approved by ignatz
help
Chatterbox?
 [LanX]: lanx wonders ... how likely is it to talk >95% BS without intention? [erix]: "gigantic amounts of data" is also not SQLite (imho) talexb wonders why sqlite2 was deprecated in favour of sqlite3. [erix]: looks like a fork, rather, no? LanX /me /me [erix]: /hehehe [marto]: LanX yesterday I found out about Gish gallop tactic [marto]: "Eugenie Scott, executive director of the National Center for Science Education, dubbed this approach the Gish gallop, describing it as "where the creationist is allowed to run on for 45 minutes or an hour, spewing forth torrents of error that the [marto]: evolutionist hasn't a prayer of refuting in the format of a debate." She also criticized Gish for failing to answer objections raised by his opponents"

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2017-07-28 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
I came, I saw, I ...

Results (431 votes). Check out past polls.