- #1

- 5

- 0

## Homework Statement

I am trying to write a program in matlab where I input certain values and get a result of possible x and y coordinates. Writing the program is not a problem, I just need to simplify the equation for matlab. I am trying to rewrite a formula so I can find what the distance is between two charges based on outputted x and y coordinates.

I am given two charges with unspecified magnitudes, q1 and q2, as well as, the constant(k) 9*10^9Nm^2/C^2. Based on whatever value I input for V, I would like to output possible x and y values. (x,y) are the points used for the first charge, (x1,y1) are the points used for the second charge, and (x2,y2) are the points used for the test point.

## Homework Equations

Formula I am using to find potential difference between the two: V=k(q1)/r1+k(q2)/r2.

r1=√((x2-x1)^2+(y2-y1)^2)

r2=√((x2-x)^2+(y2-y)^2)

## The Attempt at a Solution

I first found out what the distance would be if given that V=0, q1=(+1) and q2=(-1). Input the values: 0V=k(1)/r1+k(-1)/r2. After you move k(-1)/r2 to the left and cancel out k on both sides, you come out with r1=r2. This would mean that the distance between q1 and q2 is right in the middle or a straight line.

So... what would it be if V=1 with charges of the same magnitudes? Well, input your values again and get 1V=k(1)/r1+k(-1)/r2. Move k(-1)/r2 to the left giving you 1V+k(1)/r2=k(1)/r1. Multiply by (r1*r2) to give you r1(1V-k(1))=r2(k(1)), then divide r2 and (1V-k(1)) to give you (r1/r2)=[k(1)/(1-k(1))]. You then square both sides to get (r1/r2)^2=[k(1)/(1-k(1))]^2. This is where I get hung up. I'm not sure I can simplify even further so is to cancel out any unnecessary values. Also, would I need to specify possible points of the test point, the first charge or the second charge so is to find the others?

Thank you for your time.