Math's Trig Versus Basic's Trig Functions
#44
The part enclosed in...
'----------------------------------------------------------------------
            cx = POS(0): cy = CSRLIN
            stepX = ABS(cx - mx): stepY = ABS(cy - my)

            dAng = INT(_R2D(_ATAN2(my - cy, mx - cx)) + .5)
            IF dAng < 0 THEN dAng = dAng + 360

            IF dAng <= 90 THEN
                startA = 0: endA = dAng: ra = dAng
            ELSEIF dAng <= 180 THEN
                startA = dAng: endA = 180: ra = 90 - (dAng - 90)
            ELSEIF dAng <= 270 THEN
                startA = 180: endA = dAng: ra = dAng - 180
            ELSEIF dAng <= 360 THEN
                startA = dAng: endA = 360: ra = 90 - (dAng - 270)
            END IF
            '----------------------------------------------------------------------

...is a portion of the code you posted in post #1 of this thread: https://staging.qb64phoenix.com/showthre...31#pid4631

I'll have a look at the other methods, too. I've never had the need to use trig functions in a program prior to this, so this is new and interesting stuff fr me, and I have a use for it now, to boot!

Thanks,

Pete
Reply


Messages In This Thread
RE: Math's Trig Versus Basic's Trig Functions - by Pete - 10-08-2022, 03:17 PM



Users browsing this thread: 18 Guest(s)