{"id":136,"date":"2026-02-25T20:31:12","date_gmt":"2026-02-25T20:31:12","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/l_lazar\/?p=136"},"modified":"2026-02-25T20:31:35","modified_gmt":"2026-02-25T20:31:35","slug":"now-for-this-this-sum-ive-been-working-on-with-ai-and-it-been-about-a-month-of-trying-to-figur-it-out-and-i-still-dont-under-stand-it","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/l_lazar\/2026\/02\/25\/now-for-this-this-sum-ive-been-working-on-with-ai-and-it-been-about-a-month-of-trying-to-figur-it-out-and-i-still-dont-under-stand-it\/","title":{"rendered":"now for this, this sum ive been working on with ai and it been about a month of trying to figur it out and i still dont under stand it 2\/13\/26"},"content":{"rendered":"\n<p>heres the code <\/p>\n\n\n\n<p><em>import<\/em> turtle<\/p>\n\n\n\n<p><em>import<\/em> math<\/p>\n\n\n\n<p><em>import<\/em> colorsys<\/p>\n\n\n\n<p><em># Setup<\/em><\/p>\n\n\n\n<p>screen = turtle.Screen()<\/p>\n\n\n\n<p>screen.bgcolor(&#8220;black&#8221;)<\/p>\n\n\n\n<p>screen.title(&#8220;Geometric Harmony&#8221;)<\/p>\n\n\n\n<p>screen.tracer(0)<\/p>\n\n\n\n<p>t = turtle.Turtle()<\/p>\n\n\n\n<p>t.hideturtle()<\/p>\n\n\n\n<p>t.speed(0)<\/p>\n\n\n\n<p><em># Configuration<\/em><\/p>\n\n\n\n<p>num_shapes = 12<\/p>\n\n\n\n<p>angle = 0<\/p>\n\n\n\n<p>colors = []<\/p>\n\n\n\n<p><em># Generate colors as hex strings<\/em><\/p>\n\n\n\n<p><em>for<\/em> i <em>in<\/em> range(360):<\/p>\n\n\n\n<p>&nbsp; &nbsp; h = i \/ 360<\/p>\n\n\n\n<p>&nbsp; &nbsp; s = 0.8<\/p>\n\n\n\n<p>&nbsp; &nbsp; l = 0.5 + 0.3 * math.sin(i * 0.05)<\/p>\n\n\n\n<p>&nbsp; &nbsp; r, g, b = colorsys.hls_to_rgb(h, l, s)<\/p>\n\n\n\n<p>&nbsp; &nbsp; r, g, b = int(r*255), int(g*255), int(b*255)<\/p>\n\n\n\n<p>&nbsp; &nbsp; colors.append(<em>f<\/em>&#8220;#{r<em>:02x<\/em>}{g<em>:02x<\/em>}{b<em>:02x<\/em>}&#8221;)<\/p>\n\n\n\n<p><em>def<\/em> draw_polygon(x, y, sides, size, rot, color_idx):<\/p>\n\n\n\n<p>&nbsp; &nbsp; &#8220;&#8221;&#8221;Draw a rotated polygon at given position&#8221;&#8221;&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.penup()<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.goto(x, y)<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.setheading(rot)<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.pendown()<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.color(colors[color_idx % 360])<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.pensize(2)<\/p>\n\n\n\n<p>&nbsp; &nbsp; <em>for<\/em> _ <em>in<\/em> range(sides):<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.forward(size)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.left(360 \/ sides)<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.penup()<\/p>\n\n\n\n<p><em>def<\/em> draw_rose_curve():<\/p>\n\n\n\n<p>&nbsp; &nbsp; &#8220;&#8221;&#8221;Draw mathematical rose curves (polar coordinates)&#8221;&#8221;&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; <em>global<\/em> angle<\/p>\n\n\n\n<p>&nbsp; &nbsp; t.clear()<\/p>\n\n\n\n<p>&nbsp; &nbsp; <em>for<\/em> ring <em>in<\/em> range(3):<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; r_offset = ring * 80<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; petals = 5 + ring * 2<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; <em>for<\/em> i <em>in<\/em> range(0, 360, 3): &nbsp;<em># Skip steps for speed<\/em><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <em># Rose curve formula: r = a * cos(k * theta)<\/em><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k = petals<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r = (r_offset + 30) * math.cos(k * math.radians(i))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <em># Add wave perturbation<\/em><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r += 15 * math.sin(math.radians(i * 3) + angle)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x = r * math.cos(math.radians(i) + angle * 0.5)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y = r * math.sin(math.radians(i) + angle * 0.5)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color_idx = (i * 2 + ring * 60 + int(angle * 20)) % 360<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t.goto(x, y)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t.dot(3, colors[color_idx])<\/p>\n\n\n\n<p>&nbsp; &nbsp; <em># Draw rotating hexagons<\/em><\/p>\n\n\n\n<p>&nbsp; &nbsp; <em>for<\/em> i <em>in<\/em> range(num_shapes):<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; rot = i * (360 \/ num_shapes) + angle * 30<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; dist = 100 + 50 * math.sin(angle * 2 + i)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; x = dist * math.cos(math.radians(i * 30 + angle * 20))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; y = dist * math.sin(math.radians(i * 30 + angle * 20))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; color_idx = (i * 30 + int(angle * 15)) % 360<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; draw_polygon(x, y, 6, 30, rot, color_idx)<\/p>\n\n\n\n<p>&nbsp; &nbsp; <em># Draw connecting lines<\/em><\/p>\n\n\n\n<p>&nbsp; &nbsp; t.penup()<\/p>\n\n\n\n<p>&nbsp; &nbsp; <em>for<\/em> i <em>in<\/em> range(num_shapes):<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; x1 = 100 * math.cos(math.radians(i * 30 + angle * 20))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; y1 = 100 * math.sin(math.radians(i * 30 + angle * 20))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; x2 = 100 * math.cos(math.radians((i + 1) * 30 + angle * 20))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; y2 = 100 * math.sin(math.radians((i + 1) * 30 + angle * 20))<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.goto(x1, y1)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.pendown()<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.color(colors[(i * 30) % 360])<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.goto(x2, y2)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; t.penup()<\/p>\n\n\n\n<p>&nbsp; &nbsp; angle += 0.03<\/p>\n\n\n\n<p>&nbsp; &nbsp; screen.update()<\/p>\n\n\n\n<p>&nbsp; &nbsp; screen.ontimer(draw_rose_curve, 16)<\/p>\n\n\n\n<p><em># Start<\/em><\/p>\n\n\n\n<p>draw_rose_curve()<\/p>\n\n\n\n<p>screen.mainloop()<\/p>\n\n\n\n<p>i know what most of it dose but the math is where i asked ai for help its super complacted and heres what it dose <\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"912\" height=\"767\" src=\"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-1.png\" alt=\"\" class=\"wp-image-137\" srcset=\"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-1.png 912w, https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-1-300x252.png 300w, https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-1-768x646.png 768w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"863\" height=\"707\" src=\"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-2.png\" alt=\"\" class=\"wp-image-138\" srcset=\"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-2.png 863w, https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-2-300x246.png 300w, https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-2-768x629.png 768w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"717\" src=\"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-3.png\" alt=\"\" class=\"wp-image-139\" srcset=\"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-3.png 901w, https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-3-300x239.png 300w, https:\/\/theroyalscode.com\/students\/l_lazar\/wp-content\/uploads\/2026\/02\/image-3-768x611.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/figure>\n\n\n\n<p>it moves over time and it JUST LOOKS SUPER COOL <\/p>\n","protected":false},"excerpt":{"rendered":"<p>heres the code import turtle import math import colorsys # Setup screen = turtle.Screen() screen.bgcolor(&#8220;black&#8221;) screen.title(&#8220;Geometric Harmony&#8221;) screen.tracer(0) t = turtle.Turtle() t.hideturtle() t.speed(0) # Configuration num_shapes = 12 angle = 0 colors = [] # Generate colors as hex strings for i in range(360): &nbsp; &nbsp; h = i \/ 360 &nbsp; &nbsp; s = 0.8 &nbsp; &nbsp; l = 0.5 + 0.3 * math.sin(i * 0.05) &nbsp; &nbsp; r, g, b = colorsys.hls_to_rgb(h, l, s) &nbsp; &nbsp; r, g, b = int(r*255), int(g*255), int(b*255) &nbsp; &nbsp; colors.append(f&#8220;#{r:02x}{g:02x}{b:02x}&#8221;) def draw_polygon(x, y, sides, size, rot, color_idx): &nbsp; &nbsp; &#8220;&#8221;&#8221;Draw a rotated<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":2,"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":141,"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/posts\/136\/revisions\/141"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_lazar\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}