# Magnetic Field created from Current of Wire

1. Dec 5, 2012

### letsgo

So let's say I have a current, going into the page (that is, -$\hat{k}$). And now let's say you're trying to figure out the magnitude and direction of the magnetic field 0.0346 m away from it, in the SW direction (45 degrees).

How would you calculate the answer in terms of unit vectors $\hat{i}$ and $\hat{j}$?

I know these two formulas: B=μI/2∏r, and then to determine the direction of B= I x r, cross product.

So if I follow this, I get a B value of 7.63x10-6.

But this is where I get confused; finding the direction. I know, from drawing a diagram or even using B = I x r, cross product, that the direction is 45 degrees NW. But how would I express this in terms of unit vectors $\hat{i}$ and $\hat{j}$?

2. Dec 5, 2012

### dydxforsn

You can do a vector projection of B onto the $\hat{i}$ and $\hat{j}$ directions.

So for the $\hat{i}$ direction you can just do $$B_{i} = \frac{\vec{B} \circ \hat{i}}{|\hat{i}|}$$
and for the $\hat{j}$ direction you can do$$B_{j} = \frac{\vec{B} \circ \hat{j}}{|\hat{j}|}$$
That gives you the value of the vector B in the direction you want ($\vec{B} = <B_i, B_j, 0>$).

You can easily get the value of '$\theta$' to use in the dot products in the numerators by using the angle between the position vector to the point who's magnetic field is in question and the axis in question. This would just be the '$\theta$' for the position vector to the point, however, and not the magnetic field. Thus you need to add or subtract 90 degrees to the angle because the magnetic field is pointed 90 degrees away from the direction of the position vector.

Last edited: Dec 5, 2012