{"id":35145177,"url":"https://github.com/wendtpiotr/electric-field-visualizer","last_synced_at":"2026-05-12T23:33:57.128Z","repository":{"id":321819315,"uuid":"1087286765","full_name":"wendtpiotr/electric-field-visualizer","owner":"wendtpiotr","description":"Interactive Physics Simulation of Electric Fields Using Unity and RK4 Integration","archived":false,"fork":false,"pushed_at":"2025-10-31T17:05:29.000Z","size":82,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T23:52:56.055Z","etag":null,"topics":["coulomb-law","electric-field-lines","physics-simulation","rk4-algorithm","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wendtpiotr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-31T16:57:45.000Z","updated_at":"2025-12-27T17:09:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wendtpiotr/electric-field-visualizer","commit_stats":null,"previous_names":["pietras333/electric-field-visualizer","wendtpiotr/electric-field-visualizer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wendtpiotr/electric-field-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wendtpiotr%2Felectric-field-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wendtpiotr%2Felectric-field-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wendtpiotr%2Felectric-field-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wendtpiotr%2Felectric-field-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wendtpiotr","download_url":"https://codeload.github.com/wendtpiotr/electric-field-visualizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wendtpiotr%2Felectric-field-visualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32961785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["coulomb-law","electric-field-lines","physics-simulation","rk4-algorithm","unity3d"],"created_at":"2025-12-28T13:40:28.537Z","updated_at":"2026-05-12T23:33:57.123Z","avatar_url":"https://github.com/wendtpiotr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ Electric Field Visualizer — Unity Simulation\n\n### 🧠 *Interactive Physics Simulation of Electric Fields Using Unity and RK4 Integration*\n\n\u003cimg width=\"1918\" height=\"885\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b478fe19-4379-4619-a1a7-d405cd7a773e\" /\u003e\n\nhttps://github.com/user-attachments/assets/79c53b16-531c-4ef9-93da-2b88c3438eaf\n\n---\n\n## 🌍 Overview\n\n**Electric Field Visualizer** is a **real-time 3D simulation** of electrostatic fields generated by *many* moving point charges.\nIt brings together **Coulomb’s Law**, **Gauss’s Law**, and **numerical integration (RK4)** to create a realistic, dynamic visualization of electric fields evolving in time and space.\n\nEach charge contributes to the overall field, and the superposition principle ensures accurate interactions between dozens of charges simultaneously — **in real time**.\n\n---\n\n## 🧪 Core Concepts\n\n### 🧲 Coulomb’s Law\n\nEvery point charge generates an electric field **E** described by:\n\n[\n\\vec{E} = \\frac{1}{4 \\pi \\varepsilon_0} \\cdot \\frac{q}{r^2} \\hat{r}\n]\n\nWhere:\n\n* ( q ) — charge magnitude (C)\n* ( \\hat{r} ) — unit vector from charge to observation point\n* ( \\varepsilon_0 ) — permittivity of free space\n\nThe simulation adds up all contributions from each charge to compute the resultant vector field.\n\n---\n\n### 🔁 Field Line Tracing (Runge–Kutta 4)\n\nTo visualize electric field lines, we integrate the electric field vector field using **Runge–Kutta 4 (RK4)** — a 4th-order accurate method.\n\n[\n\\vec{r}_{n+1} = \\vec{r}_n + \\frac{h}{6}(k_1 + 2k_2 + 2k_3 + k_4)\n]\n\nThis ensures:\n\n* Smooth, continuous trajectories for field lines\n* Numerical stability even near strong field gradients\n* Correct directionality and convergence around opposite charges\n\n---\n\n### 🌀 Moving Point Charges\n\nUnlike static field plots, this system supports **dynamically moving charges** using RK4 integration for motion as well:\n\n* Charges can **orbit**, **rotate**, or **follow defined motion patterns** around a central point.\n* Each charge’s motion continuously updates the surrounding field — creating a *time-dependent* electrostatic visualization.\n* The system efficiently handles **many simultaneous charges** (tens or even hundreds, depending on setup), maintaining stable framerates through optimized computation and procedural line management.\n\n---\n\n### 🌊 Oscillating Charge Magnitudes\n\nCharge strengths can smoothly **oscillate** using **Perlin noise**, simulating fluctuations in field intensity — ideal for representing pulsating or dynamic systems.\n\n---\n\n## 💡 Scientific Highlights\n\n| Feature                             | Description                                                      |\n| ----------------------------------- | ---------------------------------------------------------------- |\n| ⚙️ **Numerical Integration**        | RK4 method used for both motion and field tracing.               |\n| ⚡ **Coulomb Field Calculation**     | Real-time vector summation from multiple sources.                |\n| 🧮 **Gauss’s Law Visualization**    | Field line density proportional to net charge magnitude.         |\n| 🌀 **Dynamic Multi-Charge Support** | Move, rotate, or oscillate dozens of charges simultaneously.     |\n| 🎨 **Gradient Field Lines**         | Continuous color blending between positive and negative sources. |\n\n---\n\n## 🧰 Technologies Used\n\n* 🧩 **Unity Engine (C#)** — Real-time 3D rendering \u0026 simulation framework\n* 🧵 **LineRenderer** — Procedural field line drawing\n* 🔄 **RK4 Integration** — Stable and accurate motion and field evolution\n* 🌈 **Perlin Noise** — Smooth charge oscillation modeling\n* 🧮 **Coulomb + Gauss Foundations** — Field superposition and flux concepts\n* 🧠 **Optimized Object Pooling** — Efficient handling of many field lines and charge markers\n\n---\n\n## 🚀 Getting Started\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/pietras333/ElectricFieldVisualizer.git\n   ```\n2. Open in **Unity 2021.3+**.\n3. Add the `ElectricFieldVisualizer` prefab to your scene.\n4. Configure:\n\n   * 🔋 Number of charges\n   * 🌀 Motion (rotation/oscillation)\n   * ⚙️ Visual parameters (field lines per charge, color gradients)\n5. Press **Play** — and watch the field come alive!\n\n---\n\n## 🔭 What You’ll See\n\n* 🟥 **Positive charges** radiate outward field lines.\n* 🟦 **Negative charges** attract lines inward.\n* 🌀 Moving charges dynamically distort and reshape the field.\n* 💫 Multiple charges interact through **superposition**, forming complex field structures and interference zones.\n\n---\n\n## 📘 Future Work\n\n* ⚡ GPU-accelerated field computation (Compute Shaders)\n* 🌈 Adaptive field line density for charge clusters\n* 🔋 Integration with **Maxwell’s Equations** to simulate electromagnetic waves\n* 🎥 Real-time export for educational or research animations\n\n---\n\n## 🧬 License\n\nMIT License — Free to use, modify, and expand for physics education, visualization research, or scientific art.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwendtpiotr%2Felectric-field-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwendtpiotr%2Felectric-field-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwendtpiotr%2Felectric-field-visualizer/lists"}