Electric Field Lines

Four charged particles are are randomly placed using JavaScript and the field lines are calculated. You can click-drag any of these particles. Start


Script Example

<script language="JavaScript"> 
function field(){
   document.EField.setDefault();
   document.EField.setShowTime(false);
   document.EField.setDrag(true);
   document.EField.setShowForce(false);
   document.EField.setChargeRGB(0,0,0);
   document.EField.setChargeLabel("1");  
   document.EField.addCharge(0.25+Math.random(),0.25+Math.random(),3);
   document.EField.setChargeLabel("3"); 
   document.EField.addCharge(0.25+Math.random(),0.25+Math.random(),-1);
   document.EField.setChargeLabel("2");  
   document.EField.addCharge(0.25+Math.random(),0.25+Math.random(),1);
   document.EField.setChargeLabel("4"); 
   document.EField.addCharge(0.25+Math.random(),0.25+Math.random(),-3);
   document.EField.setShowFieldLines(true);
}
</script>

Documentation