Model of a set of static electric point charges in two dimensions (with a 3d Gauss law). Computes the electric field strength as vector field and the absolute value and the potential as scalar fields. For conveniance it provides common scale factors for the charges and for the position vectors. It sends a trigger event to notify of general changes and can be asked to send a vector event with the field strength at a given point.
Suitable views:
Properties:
int nCharges | number of point charges |
Point2dVector coordinates | coordinates of the charges |
DVector charges | values of the electrical charges |
boolean scalarfieldIsPotential | if true, the scalar value is the electric potential, otherwise it is the absolute value of the field strength |
double chargeScale | common scale factor for all charges |
double distanceScale | common scale factor for all position vectors |
Methods:
DVector getVectorValue(DVector v) | returns electric field strength at coordinates given by v |
double getScalarValue(DVector v) | returns potential or absolute value of field strength, according to the flag scalarfieldIsPotential |
double getPotential(DVector v) | returns electric potential at coordinates given by v |
Events:
TriggerEvent | signals general change |
VectorEvent | sends electric field value at a specified position |