Electrostatic Calculation and Visualization
![]() |
In physics, the space surrounding an electric charge has a property called an electric field. This electric field exerts a force on other charged objects. The concept of electric field was introduced by Michael Faraday.
This tutorial shows the GSSE and the graphical preparation of the electrical field of a point charge. First the field is calculated using GSSE methods, then you have to use a visualization mechanism to create a picture of the field.
Tasks
- L1: Assign vertex values for the electric field as well as the electrostatic potential:
Use the mapped_type in order to store the values. In these formulae
denotes the distance between the location of the point charge
and the point of the field
. The unit vector
stands for the vector which points from
to
. - L1: Implement a function which determines the euclidian norm of an arbitrary vector. Use this formula in order to determine the distance
. The euclidian norm of a n-dimensional vector can be derived as
.
For two dimensions the distance can be implemented as follows:
return std::sqrt(pnt[0]*pnt[0] + pnt[1]*pnt[1])
- L2: Implement such a formula for the GSSE point type independently of its dimension.
- L2: Implement a direction function. The unit vector of the direction can be implemented using the following formula:
- L2: Next, implement the formulae for the potential as well as the electrical field. For this reason place the point charge
and insert values for q and
. Evaluate the formulae on all vertices. - L1: For the storage of the components of the electric field use two separate quantities.
