# Vector field calculations- dumb question

1. Jul 12, 2011

Given 2 vectors, say x and y with a relationship of barXx-barYy (barX =1,0,0 and barY=0,1,0) calculations for the vector field in x and y plane are:
Magnitude = sqrt(x2+y2)
tails of vectors begin at input points (IE: if I choose 1,0 or 0,-1 etc) and the magnitudes are calcluated from these values with the equation above.
Question: how to find the angle of the vectors? If I use ones and zeros and the BarX dot BarYCos theta how to get theta? also barXdot BarY is zero making the whole thing zero?

2. Jul 12, 2011

### Staff: Mentor

Does this reference help?

http://www.algebralab.org/lessons/lesson.aspx?file=Trigonometry_TrigVectorDotProd.xml

.

3. Jul 12, 2011

this gives the formula cos theta = barV dot bar U / the magnitudes of vu. as mentioned before this returns a value of zero whether the y component or the x component is zero. so this means each vector with a zero Y component has a 90 degree vector and this cannot be.

4. Jul 12, 2011

### Staff: Mentor

Since the two vectors are obviously perpendicular, their dot product is zero, and hence the angle between them is 90 degrees.

One way that the dot product of two vectors is defined is:
$$\vec{u} \cdot \vec{v} = |\vec{u}||\vec{v}| \cos(\theta)$$

You can solve this equation for cos(theta) like so:
$$\cos(\theta) = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}||\vec{v}| }$$