Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:16 17 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Hilbert curve

Author Message
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 09:17am 28 Feb 2021
Copy link to clipboard 
Print this post

Hilbert Curve


Hilbert Curve.zip


'Hilbert Curve
cls : oder = 5 : turn = -1 : dx = 0
dy = 100 / oder : x = 100 : y = 50  
first()
end
sub first
 inc oder, -1
 fifth()
 fifth()
 third()
 sixth()
 third()
 inc oder
end sub
sub second
 if oder > 0 then first()
 sixth()
end sub
sub third
 if oder > 0 then first()
 seventh()
 turn = -turn
end sub
sub fourth
 turn = -turn
 seventh()
end sub
sub fifth
 fourth()
 second()
end sub
sub sixth
 px = x : x = x + dx
 py = y : y = y + dy
 line px, py, x, y, 1, rgb(yellow)
end sub
sub seventh
 tmp = dy
 dy = -turn * dx
 dx = turn * tmp
end sub
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 596
Posted: 02:02am 02 Mar 2021
Copy link to clipboard 
Print this post

Like it . Cool background gfx .
Plasma
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 596
Posted: 02:02am 02 Mar 2021
Copy link to clipboard 
Print this post

Like it . Cool background gfx .
Plasma
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025