blob: 993c97164497d4b46324aecdeaf98b9de863db6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//Example 18.3
q=-0.250*10^-6;//Charge (C)
E=7.20*10^5;//Electric field strength, See Example 18.2 (N/C)
F=-q*E;//Force (N)
printf('Force on the charge = %0.3f N',F)
if q<0
printf('\nDirection of force is opposite to direction of field')
else
printf('\nDirection of force is the same as the direction of field')
end
//Openstax - College Physics
//Download for free at http://cnx.org/content/col11406/latest
|