Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Check if line is straight

by lidden (Deacon)
on May 16, 2011 at 23:13 UTC ( #905169=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Check if line is straight
in thread Check if line is straight

return abs(($x2-$x1)*($y-$y1)-($x-$x1)*($y2-$y1)) < $tolerance;

Update added abs()


Comment on Re^3: Check if line is straight
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://905169]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2014-09-22 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls