Ugh. Is my math (and logic) right?
#10
And the instant I posted that last one, wait a minute ...

Problem solved with a little security (last two lines added to bLine):

Code: (Select All)
Sub bLine (x1, y1, x2, y2)
    dx = x2 - x1
    dy = y2 - y1
    dist = Sqr(dx * dx + dy * dy)
    dx = dx / dist
    dy = dy / dist
    For i = 0 To dist
        PSet (x1 + dx * i, y1 + dy * i)
    Next
    Pset (x1,y1)
    Pset (x2,y2)
End Sub
Reply


Messages In This Thread
Ugh. Is my math (and logic) right? - by CharlieJV - 08-29-2023, 12:47 AM
RE: Ugh. Is my math (and logic) right? - by bplus - 08-29-2023, 01:12 AM
RE: Ugh. Is my math (and logic) right? - by bplus - 08-29-2023, 02:00 AM
RE: Ugh. Is my math (and logic) right? - by CharlieJV - 08-29-2023, 03:09 AM
RE: Ugh. Is my math (and logic) right? - by bplus - 08-29-2023, 12:26 PM



Users browsing this thread: 3 Guest(s)