Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tree
#6
(03-06-2025, 04:04 PM)Marcus Wrote: ... I took the liberty and fixed it a bit Smile  It's better to use the parametric line equation when doing things like this.

Code:
...
function trunk(x1,y1,x2,y2,t)
    'reduce thickness
    t = t/1.1

    ' marcus.
    dx = x2 - x1; dy = y2 - y1
    d = sqr(dx*dx + dy*dy)
    dx = dx/d; dy = dy/d
    for i = 1 to d
        draw ellipse x1, y1, t, t, true
        x1 = x1 + dx; y1 = y1 + dy
    next
endfunc
...

Awesome. Thank you, Marcus  Big Grin

Parametric equation in calculus shine
With slopes and integrals, neatly defined
In coding, they help with performance so tight
Solving equations with the speed of light
Reply


Messages In This Thread
Tree - by 1micha.elok - 03-04-2025, 09:36 AM
RE: Tree - by johnno56 - 03-04-2025, 10:29 AM
RE: Tree - by indru91112 - 03-04-2025, 01:47 PM
RE: Tree - by aurel - 03-05-2025, 02:07 PM
RE: Tree - by Marcus - 03-06-2025, 04:04 PM
RE: Tree - by 1micha.elok - 03-07-2025, 03:22 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)