I NEED HELP!!! my teacher thinks i know how to write a program that determines the
force on a charge Q due to two other charges. All charges are to be in the
x-y plane. Your program must prompt the user for the magnitudes and
locations of 3 distinct changes, then ask which charge you are interested
in, then the program determines the net force acting on the charge of
interest due to the other two charges. Your program must be able to handle
either positive or negative charges. It expresses the answer (net force) in
polar form giving magnitude and direction relative to the positive x axis.
Use the vector form of Coulomb's Law.
As long as the charges are in the x-y plane, you could use complex numbers as a shortcut for using vectors (adding and subtracting vectors is the same as acting and subtracting complex numbers). For a vector written as a complex number, abs( and angle( give the magnitude and direction in polar form.
If you don't want to or can't think of how to use complex numbers, using the vectors' components will work just as well. R►Pr( will convert from component form to magnitude, R►Pθ( from component form to direction.
so how do you do it ?
so, can anyone tell how to do the program'?
:For(I,1,3
:"Charge "+sub("123",I,1)
:Input Ans+" x?",A
:Input Ans+" y?",B
:Input Ans+" q?",C
:A+Bi→L1(I
:C→L2(I
:End
:Input "Which charge?",N
:0→F
:For(I,1,3
:If I≠N:Then
:L1(N)-L1(I
:F+9E9L2(I)L2(N)Ans/abs(Ans³→F
:End
:End
:Disp "Magnitude:",abs(F),"Direction:
:angle(F
thanks for helping me… but as sooon as i get to A+Bi…when running program, it says syntax error
i is the i you get when pressing [2nd] [.], not just a lowercase i.