Circles from Chords :) KingAshish Registered Offline This member has written at least 58 posts and created at least 15 threads on this forum since joining inNov 2016. 09-17-2017, 01:06 AM This post was last modified: 09-17-2017, 01:09 AM by KingAshish.Edited 0 times Hi everyone! I've found that when the chords of the circle is rotated around it's boundaries then many small circles are formed inside that circle, creating a beautiful pattern. 4 I know that most of you had already knew this, but I'm new at this! Here's the code - Code:```RANDOMIZE TIMER _TITLE "Circles from Chords [Press Space for new Pattern]" SCREEN _NEWIMAGE(700, 700, 32) TYPE vector    x AS SINGLE    y AS SINGLE END TYPE TYPE chord    startPos AS vector 'starting position    endPos AS vector 'end position    col AS _UNSIGNED LONG 'color of the chord    ang AS _FLOAT    dist AS _FLOAT 'angle between the two points of chords of a circle in radians.    angInc AS _FLOAT 'speed    currentAng AS _FLOAT END TYPE DIM CircleChords(10) AS chord, Center AS vector Center.x = _WIDTH / 2 Center.y = _HEIGHT / 2 init: CLS faded = 255 FOR i = 0 TO UBOUND(CircleChords)    CircleChords(i).col = _RGBA(RND * 256, RND * 256, RND * 256, 40)    CircleChords(i).ang = ang#    CircleChords(i).dist = (RND * _PI) + 0.5    CircleChords(i).angInc = RND * .3 + 0.1    ang# = ang# + _PI(2) / UBOUND(circlechords) NEXT DO    f% = 0    IF faded > 0 THEN        FOR i = 0 TO UBOUND(circlechords)            CircleChords(i).startPos.x = COS(CircleChords(i).ang + CircleChords(i).currentAng) * Center.x + Center.x            CircleChords(i).startPos.y = SIN(CircleChords(i).ang + CircleChords(i).currentAng) * Center.y + Center.y            CircleChords(i).endPos.x = COS(CircleChords(i).ang + CircleChords(i).dist + CircleChords(i).currentAng) * Center.x + Center.x            CircleChords(i).endPos.y = SIN(CircleChords(i).ang + CircleChords(i).dist + CircleChords(i).currentAng) * Center.y + Center.y            LINE (CircleChords(i).startPos.x, CircleChords(i).startPos.y)-(CircleChords(i).endPos.x, CircleChords(i).endPos.y), CircleChords(i).col            CircleChords(i).currentAng = CircleChords(i).currentAng + CircleChords(i).angInc        NEXT        faded = faded - 1    ELSE        CLS        DO            FOR i = 0 TO UBOUND(circlechords)                CircleChords(i).startPos.x = COS(CircleChords(i).ang + CircleChords(i).currentAng) * Center.x + Center.x                CircleChords(i).startPos.y = SIN(CircleChords(i).ang + CircleChords(i).currentAng) * Center.y + Center.y                CircleChords(i).endPos.x = COS(CircleChords(i).ang + CircleChords(i).dist + CircleChords(i).currentAng) * Center.x + Center.x                CircleChords(i).endPos.y = SIN(CircleChords(i).ang + CircleChords(i).dist + CircleChords(i).currentAng) * Center.y + Center.y                LINE (CircleChords(i).startPos.x, CircleChords(i).startPos.y)-(CircleChords(i).endPos.x, CircleChords(i).endPos.y), CircleChords(i).col                CircleChords(i).currentAng = CircleChords(i).currentAng + CircleChords(i).angInc            NEXT            f% = f% + 1        LOOP UNTIL f% > 300    END IF    '_LIMIT 40    _DISPLAY    IF _KEYHIT = ASC(" ") THEN GOTO init LOOP``` I hope you will enjoy it. Attached Files Thumbnail(s) johnno56 Registered Offline This member has written at least 261 posts and created at least 17 threads on this forum since joining inApr 2017. 09-17-2017, 02:27 PM This is pretty cool... Did not expect the rotation... cool. J May your journey be free of incident. Live long and prosper. « Next Oldest | Next Newest » 