{"id":18084089,"url":"https://github.com/linuxfandudeguy/julia-set-generator","last_synced_at":"2026-04-16T12:41:53.593Z","repository":{"id":259769745,"uuid":"879386297","full_name":"linuxfandudeguy/julia-set-generator","owner":"linuxfandudeguy","description":"Julia-set generator made with SvelteKit.","archived":false,"fork":false,"pushed_at":"2025-01-12T01:55:32.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T23:42:22.691Z","etag":null,"topics":["fractal","julia","julia-set","julia-sets","mandelbrot","mandelbrot-fractal","pnpm","svelte","sveltekit","tailwind-css","tailwindcss","vite"],"latest_commit_sha":null,"homepage":"https://fractalgen.vercel.app/","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxfandudeguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T19:05:40.000Z","updated_at":"2025-01-12T01:55:35.000Z","dependencies_parsed_at":"2024-10-27T23:39:54.555Z","dependency_job_id":"9a0c4248-c475-4b65-a247-6aa9826d24bc","html_url":"https://github.com/linuxfandudeguy/julia-set-generator","commit_stats":null,"previous_names":["linuxfandudeguy/julia-set-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fjulia-set-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fjulia-set-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fjulia-set-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fjulia-set-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxfandudeguy","download_url":"https://codeload.github.com/linuxfandudeguy/julia-set-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxfandudeguy%2Fjulia-set-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259136932,"owners_count":22810568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fractal","julia","julia-set","julia-sets","mandelbrot","mandelbrot-fractal","pnpm","svelte","sveltekit","tailwind-css","tailwindcss","vite"],"created_at":"2024-10-31T15:05:41.599Z","updated_at":"2026-04-16T12:41:48.545Z","avatar_url":"https://github.com/linuxfandudeguy.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# julia-set-generator\n \nA random Julia set generator, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).\n\n## How it Works\nThe JavaScript snippet that generates the fractal will be displayed down here with comments explaining how it works.\n\n```javascript\n// Importing the onMount lifecycle function from Svelte\nimport { onMount } from 'svelte';\n\n// Declaring variables\nlet canvas; // Reference to the canvas element for drawing the fractal\nlet zoom = 1; // Initial zoom level for the fractal visualization\nlet maxIterations, cx, cy; // Variables for maximum iterations and complex constants\nlet equation = ''; // Variable to hold the equation representation for display\n\n// Function to set random values for the fractal parameters\nconst setRandomValues = () =\u003e {\n  maxIterations = Math.floor(Math.random() * 100) + 150; // Max iterations between 150 and 250\n  cx = Math.random() * 2 - 1; // Random complex constant cx between -1 and 1\n  cy = Math.random() * 2 - 1; // Random complex constant cy between -1 and 1\n};\n\n// Function to draw the fractal on the canvas\nconst drawFractal = () =\u003e {\n  const ctx = canvas.getContext('2d'); // Get the 2D rendering context for the canvas\n  const width = canvas.width; // Width of the canvas\n  const height = canvas.height; // Height of the canvas\n  ctx.clearRect(0, 0, width, height); // Clear the canvas for redrawing\n\n  // Generate new random parameters for each fractal\n  setRandomValues(); // Set new random values for maxIterations, cx, and cy\n  equation = `f(z) = z^2 + ${cx.toFixed(2)} + i * ${cy.toFixed(2)}`; // Update equation display with new constants\n\n  // Loop through each pixel of the canvas to calculate fractal colors\n  for (let x = 0; x \u003c width; x++) {\n    for (let y = 0; y \u003c height; y++) {\n      // Normalize pixel coordinates to complex plane coordinates\n      let zx = (x - width / 2) / (zoom * 100); // X-coordinate in the complex plane\n      let zy = (y - height / 2) / (zoom * 100); // Y-coordinate in the complex plane\n      let iter = 0; // Iteration counter\n\n      // Iterate to determine if the point escapes the fractal\n      while (zx * zx + zy * zy \u003c 4 \u0026\u0026 iter \u003c maxIterations) {\n        let tmp = zx * zx - zy * zy + cx; // Update zx using the fractal equation\n        zy = 2.0 * zx * zy + cy; // Update zy using the fractal equation\n        zx = tmp; // Assign updated zx value\n        iter++; // Increment iteration count\n      }\n\n      // Color mapping based on iteration count\n      let color; // Variable to store color value for the pixel\n      if (iter === maxIterations) {\n        color = 'rgb(0, 0, 0)'; // Points inside the set are colored black\n      } else {\n        // Calculate hue based on the number of iterations and map it to HSL color\n        const hue = Math.floor(360 * (iter / maxIterations)); // Map iterations to hue\n        color = `hsl(${hue}, 100%, 50%)`; // Assign a bright color in HSL format\n      }\n      ctx.fillStyle = color; // Set the fill color for the current pixel\n      ctx.fillRect(x, y, 1, 1); // Draw the pixel on the canvas\n    }\n  }\n};\n\n// Lifecycle hook to draw the fractal when the component is mounted\nonMount(() =\u003e {\n  drawFractal(); // Call the function to draw the fractal\n});\n```\n##  Examples\nThis is a list of fractals and the equations corresponding to them. (and my nickname of it)\n\n\u003cdiv align=center\u003e\n\n\n\n![Screenshot 2024-10-27 3 29 09 PM](https://github.com/user-attachments/assets/5995c346-262c-423f-a256-7a29a8f9360d)\n\n##### Kite\n\n$$\nf(z) = z^2 - 0.06 + i \\cdot 0.77\n$$\n\n\n\n![Screenshot 2024-10-27 3 31 47 PM](https://github.com/user-attachments/assets/dfc0af09-e773-4e9b-a87f-ab1acf5804c3)\n\n\n##### Rainbow Swirl\n\n$$\nf(z) = z^2 - 0.46 + i \\cdot 0.58\n$$\n\n\n![download (1)](https://github.com/user-attachments/assets/45b2be31-b9a9-4e6b-894d-e147c3c5d6ac)\n\n##### Black Gem\n\n$$\nf(z) = z^2 - 0.31 + i \\cdot 0.05\n$$\n\n![download (2)](https://github.com/user-attachments/assets/0c723431-eb01-40c5-b985-098e9cbba6ca)\n\n##### Wavy\n\n$$\nf(z) = z^2 + 0.30 + i \\cdot 0.11\n$$\n\n\n![Screenshot 2024-10-27 3 41 11 PM](https://github.com/user-attachments/assets/95367133-2623-4056-aacd-d1be9852e2d3)\n\n##### **MY EYES**\n\n$$\nf(z) = z^2 - 0.65 + i \\cdot 0.38\n$$\n\n\n\u003c/div\u003e\n\n\n## Building\n\nTo create a copy version of my app:\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/linuxfandudeguy/julia-set-generator)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxfandudeguy%2Fjulia-set-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxfandudeguy%2Fjulia-set-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxfandudeguy%2Fjulia-set-generator/lists"}