{"id":8205,"student_id":1470,"content":"setBackdrop(\"black\");\n\nstopRendering();\n\nvar zoom = 16;\nvar panX = 1.78777,\n panY = 0;\nvar maxIterations = 80;\nvar pointsList = [];\n\n\nfunction generateSet(maxIterations) {\n pointsList = [];\n for (var x = 0; x \u003c 640; x++) {\n for (var y = 0; y \u003c 480; y++) {\n var c = {\n Re: (x - 320) / zoom - panX,\n Im: (y - 240) / zoom - panY\n };\n var z = f(c, c);\n for (var i = 0; i \u003c maxIterations; i++) {\n var z_Prime = f(z, c);\n z = z_Prime;\n if (abs(z) \u003e= 2) {\n pen.color = 'hsl(170, 100%, ' + (i / maxIterations) * 100 + '%)';\n pen.drawRect(x, y, 1, 1);\n break;\n }\n }\n }\n }\n}\n\nfunction f(z, c) {\n var z_prime = {\n Re: Math.pow(z.Re, 2) - Math.pow(z.Im, 2) + c.Re,\n Im: 2 * z.Re * z.Im + c.Im\n }\n return z_prime;\n}\n\nfunction abs(z) {\n return Math.sqrt(Math.pow(z.Re, 2) + Math.pow(z.Im, 2));\n}\n\ndrawBackdrop(\"black\");\nvar startTime = new Date();\ngenerateSet(maxIterations);\nconsole.log(\"Drawing time: \"+ ((new Date())-startTime) + \"ms\"); \n\n\n\nsetInterval(function(){\n if(zoom \u003c= 13200000){\n\n \n zoom *= 2;\n maxIterations *= 1.1;\n \n drawBackdrop(\"black\");\n \n generateSet(maxIterations);\n print(\"Zoom: \" + zoom, 20, 20, \"white\");\n }\n}, 1000);","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-12T12:15:08.867+08:00","name":"Mandelbrot Set","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/8205/fd1ac05835b665cf0d7e3c5532c7c2d7.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[70],"is_featured":true,"views":2063,"hashid":"2pdske6","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":182068,"file_name":"0.png","project_id":8205,"asset_id":6,"created_at":"2017-07-25T16:09:07.415+08:00","updated_at":"2017-07-25T16:09:07.415+08:00"},{"id":182069,"file_name":"1.svg","project_id":8205,"asset_id":7,"created_at":"2017-07-25T16:09:07.418+08:00","updated_at":"2017-07-25T16:09:07.418+08:00"},{"id":182070,"file_name":"2.png","project_id":8205,"asset_id":8,"created_at":"2017-07-25T16:09:07.419+08:00","updated_at":"2017-07-25T16:09:07.419+08:00"},{"id":182071,"file_name":"0.wav","project_id":8205,"asset_id":9,"created_at":"2017-07-25T16:09:07.421+08:00","updated_at":"2017-07-25T16:09:07.421+08:00"},{"id":182072,"file_name":"1.wav","project_id":8205,"asset_id":10,"created_at":"2017-07-25T16:09:07.422+08:00","updated_at":"2017-07-25T16:09:07.422+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦