parallel lines

BlitzMax Forums/BlitzMax Programming/parallel lines

I haven't really tested this extensively, but if I were trying to find parallel lines I'd do something like this:

Local ax# = 1.0, bx# = -2.0
Local ay# = 2.0, by# = -4.0
Local az# = 3.0, bz# = 6.0

Local ratiox# = ( ax / bx )
Local ratioy# = ( ay / by )
Local ratioz# = ( az / bz )

Local ratioxy# = ( ratioy / ratiox )
Local ratioxz# = ( ratioz / ratiox )

If ( 0.9999 < ratioxy )

If ( 1.0001 > ratioxy )

If ( 0.9999 < ratioxz )

If ( 1.0001 > ratioxz )

Print "parallel"

EndIf

EndIf

EndIf

EndIf