Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PSET Circle!
#21
Quote:does any one under stand the math behind the circle? just checking

*frowns at diroga*

Yes, I do.

Quote:tetha

Dont you mean Theta Wink
Reply
#22
whats math? :bounce: no really, i do
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#23
Quote:
Neo Wrote:tetha

Dont you mean Theta Wink
Oooooops :oops: Of course, Theta is English Wink lol I just talked Dutch... tetha... lol
Reply
#24
Code:
PSET (100, 100), 15
Isn't it a circle? :lol: Big Grin :lol: Big Grin Tongue
EEL THE BEAT OF EURODANCE!!! Smile
Reply
#25
This obviously isn't an entry for this challenge, but it's a fun program nonetheless. ^_^

*peace*

Meg

[syntax="QBASIC"]
'THIS PROGRAM MAKES USE OF THE CROSSCIRCLE SUB TO DISPLAY CIRCLES WITH LINES
'CUTTING ACROSS THEM AT PRESET NODE POINTS.
' - Written 03/17/2005 by mb

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'SUB DECLARATIONS
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
DECLARE SUB CrossCircle (x!, y!, r!, c%, n%, o!)

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'CHANGE TO GRAPHICS MODE 320x200
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SCREEN 13
CLS

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'ROTATE A 10-NODE, 40-RADIUS CIRCLE IN THE CENTER OF THE SCREEN
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
offset! = 0
DO
offset! = offset! + .01
CrossCircle 160, 100, 40, 15, 10, offset!
WAIT &H3DA, 8
WAIT &H3DA, 8, 8
CrossCircle 160, 100, 40, 0, 10, offset!
LOOP UNTIL INKEY$ <> ""

SYSTEM

SUB CrossCircle (x!, y!, r!, c%, n%, o!)

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'THIS SUB DRAWS NODES AROUND A CIRCLE AND CONNECTS THEM WITH LINES
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'x! = x-coordinate of circle
'y! = y-coordinate of circle
'r! = radius of circle
'c% = color of circle
'n% = number of nodes in circle
'o! = offset of first node in radians

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'MAKE OUR NODE COORDINATE ARRAYS
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
REDIM nodeX!(1 TO n%)
REDIM nodeY!(1 TO n%)

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'STARTING AT OFFSET o!, CREATE EVENLY SPACED NODES AROUND THE CIRCLE
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
NodeDist! = (2 * 3.14159) / n%
NodeCurr! = o!
FOR i% = 1 TO n%
nodeX!(i%) = x! + COS(NodeCurr!) * r!
nodeY!(i%) = y! - SIN(NodeCurr!) * r!
NodeCurr! = NodeCurr! + NodeDist!
NEXT i%

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'CONNECT THE NODES TO EACH OTHER WITH LINES
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
FOR i% = 1 TO n% - 1
FOR j% = i% + 1 TO n%
LINE (nodeX!(i%), nodeY!(i%))-(nodeX!(j%), nodeY!(j%)), c%
NEXT j%, i%

END SUB
[/syntax]
Reply
#26
Quote:does any one under stand the math behind the circle? just checking

Knows it here,.. :wink: ... do you?

Quote:This obviously isn't an entry for this challenge, but it's a fun program nonetheless. ^_^

*peace*

Meg

Wow, thats cool!! :bounce:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#27
Wow, that was great!

lol try doing it at 160, 100, 200, 15, 25, offset!!!!! Ha lol :lol:
(FYI that rotates a 200 radius circle at the center of the screen, color 15, AND 25 nodes!) Tongue

Oh ya I do too (understand the math behind it). I had to learn all that stuff when I learned 3D in QB. Big Grin
i]"But...it was so beautifully done"[/i]
Reply
#28
i was messin' around with Diroga's entry just for fun and i made this:
[syntax="qbasic"]CLS
SCREEN 13
rad = (3.14159265#) / 180
c = 16
z = 76
SLEEP
FOR ii = 1 TO 75
z = z - 1
FOR i = 1 TO 361 STEP .5
oldx = x: oldy = y
x = INT(z * (COS(rad * i))) + 160
y = INT(z * (SIN(rad * i))) + 100
c = c + 1: IF c > 31 THEN c = 16
PSET (x, y), c
NEXT
NEXT[/syntax]
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#29
Smile Heh, okay, try this one, deff not for the comp, just for the eye:

[syntax="QBasic"]SCREEN 13
FOR a = 1 TO 360
x = a * COS(a * 3.14159265# / 180)
y = 20 * SIN(a * 3.14159265# / 180)
LINE (160, 100)-(160 + x, 100 - y), a
NEXT[/syntax]

:rotfl:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#30
Hey guess what? I was messing around with Dio's entry...hehe...oh no you say? Well, when I mess around with graphics, its more of a change here and see what happends :lol: ....well this was a little better than that...more math...not what I wanted it to do, but it looks cool:

[syntax="qbasic"]
CLS
SCREEN 13
rad = (3.14159265#) / 180
c = 16
z = 76
offset = 0
DO
offset = offset + 1
ci = (ci + 5) MOD 255
c = 16
z = 76
FOR ii = 1 TO 150
z = z - 1
FOR i = 1 TO 361 STEP .5
oldx = x: oldy = y
d = (i + offset) MOD 360
x = INT(z * (COS(rad * d))) + 160
y = INT(z * (SIN(rad * d))) + 100
c = c + 1: IF c > ci THEN c = 16
PSET (x, y), c
NEXT
NEXT
LOOP
[/syntax]
i]"But...it was so beautifully done"[/i]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)