BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Line Intersection Function"
, by ashcroftman
Converted from a maths tutorial into Blitz.
Code
Function lineIntersect(x1#,y1#,x2#,y2#,u1#,v1#,u2#,v2#) b1# = (y2 - y1) / (x2 - x1) b2# = (v2 - v1) / (u2 - u1) a1# = y1 - b1 *x1 a2# = v1 - b2 *u1 xi# = - (a1-a2)/(b1-b2) yi# = a1+b1*xi If (x1 - xi)*(xi-x2)> -1 And (u1-xi)*(xi - u2)> 0 And (y1-yi)*(yi-y2)>-1 And (v1-yi)*(yi-v2)>-1 Return True End Function
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations