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(0);
   document.EField.setNoDrag(0);
   document.EField.setShowForce(0);
   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(1);
}
</script>

Documentation