Skip to the content.
Home
EN FR

Electric Field Line Simulation in C

This program simulates electric field lines using the C programming language.
It calculates the electric fields generated by positive and negative charges, then visualizes their corresponding field lines.
The simulation provides insight into electric field behavior in complex configurations.


Features


Screenshots

Simulation with 10 positive charges, 10 negative charges, and 50 field lines

Simulation with 10 positive charges, 10 negative charges, and 50 field lines

Simulation with 100 positive charges, 100 negative charges, and 5000 field lines

Simulation with 100 positive charges, 100 negative charges, and 5000 field lines

Simulation with 5 positive charges, 10 negative charges, and 500 field lines

Simulation with 5 positive charges, 10 negative charges, and 500 field lines


Running the Program

To launch the simulation, follow these steps:

  1. Prerequisites: Make sure you have a C compiler (such as gcc) and make installed.
  2. Clone the repository:
     git clone git@github.com:ArianDervishaj/simulation-lignes-de-champs.git
    
  3. Compile and run:
     cd simulation-lignes-de-champs
     make main
     ./main <number_of_positive_charges> <number_of_negative_charges> <number_of_field_lines>
    

Learn More

View the GitHub Repository