# Subtracting vectors from different origins

#### tquiva

Joined Oct 19, 2010
176
Problem:

Attempt:

(attached)

I've been googling for examples on the internet how to do so, and my book does not show any examples either. What I've done was set both vectors at the same origin in two scenarios with the two given origins. I then accounted the change based on the origin (0,0,0) and counted points from there. For the origin (1, pi/2, 0) for instance, based on (0,0,0), I found the second component of A-B by subtracting one point from the y-axis. So instead of -7-(-4), I got -6-(-3) which gave -3 (correct from answer in back).

This method worked for some components, but not for some, so now I am lost. Is there a proper way to doing this?

#### Attachments

• 20.8 KB Views: 228
• 291.6 KB Views: 61

Joined Jul 7, 2009
1,583
Vector addition is defined to be the addition of the corresponding vector components in some common basis. Note you can't add the spherical components because the spherical basis vectors change direction with position. Hint: these are probably free vectors; what does this imply that you can do with their Cartesian coordinates?

#### tquiva

Joined Oct 19, 2010
176
So I should convert the vectors to Cartesian form and proceed from there?

Joined Jul 7, 2009
1,583
Couldn't hurt... Also, don't they teach students to make models any more (I'm assuming you're a student)? You could make a simple model from some wire and see the vectors and their relationship in space. Then the result of their subtraction should be pretty obvious. Or, just make a sketch like you were taught in your basic calculus class (NB: they probably don't teach that stuff anymore either ).

#### tquiva

Joined Oct 19, 2010
176
now I'm a bit confused from converting spherical to cartesian.

I know the formulas are:

x=rsin(θ)cos(\phi)
y=rsin(θ)sin(\phi)
z=rcos(θ)

But how would I find out what r is? Would that be the magnitude of the given vector? And how would I find theta and phi? Is that the given origin of (1, π/2, 0°) ?

Joined Jul 7, 2009
1,583

#### tquiva

Joined Oct 19, 2010
176
I'm sorry, I just want to clarify. According to the problem statement for the origin of A,

r = 1
θ = pi/2
phi = 0

Is that right?

Joined Jul 7, 2009
1,583
That's what I would assume. I interpret your spherical coordinates as (r, phi, θ) where phi is the same as the cylindrical coordinate azimuthal angle and θ is the angle from the positive z axis. But I've seen different notations and conventions, so make sure you understand what your book is using. Thus, the (1, pi/2, 0) point in spherical coordinates would be (0, 0, 1) in Cartesian coordinates (i.e., the north pole on a unit sphere).

Note: for doing these "easy" type of conversions, I never bother with the formulas -- I just trace the points out in my head. Thus, I think "OK, it's unit radius; the phi means it's aligned on the y axis; the 0 for θ means it has to lie on the z axis".

#### t_n_k

Joined Mar 6, 2009
5,455
I'm surprised that one would consider solving the problem by translation to the orthogonal (x,y,z) system to do the vector additions and then back to the spherical system to state the solution.

It certainly provides some conceptual insights regarding the link between the two systems but overlooks the obvious value & practicality of doing the whole thing in spherical co-ordinates. Presumably the expectation is that the problem is to be solved in that manner - although having an alternative approach might help sometimes.

Conceptually we shouldn't have too many issues visualizing the spherical system anyway. As someonesdad comments imply, there is an obvious connection with our own spatial perspective living on planet Earth and the spherical co-ordinate system.

Last edited:

Joined Jul 7, 2009
1,583
It certainly provides some conceptual insights regarding the link between the two systems but overlooks the obvious value & practicality of doing the whole thing in spherical co-ordinates.
Try an example: add the Cartesian i and j vectors. In spherical coordinates, i is (1, 0, pi/2) and j is (1, pi/2, pi/2). If you add the spherical components, you get (2, pi/2, pi), which is a vector pointing in the -z direction -- clearly wrong, as the answer must lie in the xy plane at an azimuth of pi/4 (in addition, the radial component has to be sqrt(2)).

The problem is that the spherical unit vectors don't have constant direction -- hence, you can't add them like you can Cartesian unit vectors.

You can also see the same type of problem in trying to add planar vectors using polar coordinates in the plane.

#### tquiva

Joined Oct 19, 2010
176
I'm still confused. So after I convert the origins of (1,pi/2,0) to (0,0,1) and (3,pi/2,pi/2) to (0,3,0).... what do I do with A and B? Do I convert these two vectors both to Cartesian form also?

#### t_n_k

Joined Mar 6, 2009
5,455
Try an example: add the Cartesian i and j vectors. In spherical coordinates, i is (1, 0, pi/2) and j is (1, pi/2, pi/2). If you add the spherical components, you get (2, pi/2, pi), which is a vector pointing in the -z direction -- clearly wrong, as the answer must lie in the xy plane at an azimuth of pi/4 (in addition, the radial component has to be sqrt(2)).

The problem is that the spherical unit vectors don't have constant direction -- hence, you can't add them like you can Cartesian unit vectors.

You can also see the same type of problem in trying to add planar vectors using polar coordinates in the plane.
Yes I see my mistake - thanks.

Joined Jul 7, 2009
1,583
The way I'd solve the problem is:

1. Get the Cartesian coordinates of the two vectors.

2. Add the corresponding Cartesian coordinates.

Did you make a wire model of things so you could see the two arrows in space? Then vector addition is that you bring the starting points of the vectors together and combine them in the plane that contains both vectors with the familiar parallelogram method (this is a coordinate-free definition of vector addition). Of course, for subtraction, you take the negative of one vector, then add them together. What's nice is that this mental picture works for vectors in any number of dimensions. In 3 dimensional space, the easiest way to do this is to use the Cartesian coordinates as indicated.

I've attached how I'd work the problem on paper. Of course, check what I've done and make sure I haven't made any errors in assumptions...

#### Attachments

• 136 KB Views: 66

#### t_n_k

Joined Mar 6, 2009
5,455
This is an interesting problem ...

The transformation between unit vectors from Cartesian to spherical is related by ..

$$\left [\bf \hat{\rho} \\ \bf \hat{\theta} \\ \bf \hat{\phi} \right ]=\left[ \bf M \right ]\left [ \bf \hat{x} \\ \bf \hat{y} \\ \bf \hat{z} \right ]=\left [ \begin{array}{cc} sin(\theta)cos(\phi) & sin(\theta)sin(\phi) & cos(\phi) \\ cos(\theta)cos(\phi) & cos(\theta)sin(\phi) & -sin(\theta) \\ -sin(\phi) & cos(\phi) & 0 \end{array}\right ] \ \left [ \bf \hat{x} \\ \bf \hat{y} \\ \bf \hat{z} \right ]$$

Consider the case of converting a Cartesian form

$$A'=a_x\bf{\hat{x}}+a_y\bf{\hat{y}}+a_z\bf{\hat{z}}$$

to the spherical form

$$A=a_{\rho} \bf{\hat{\rho}}+a_{\theta} \bf{\hat{\theta}}+a_{\phi}\bf{\hat{\phi}}$$

Note: There's a reason I'm going this direction rather than spherical to Cartesian

Firstly, one needs to deduce the values

$$\left [ \rho \\ \theta \\ \phi \right ]=\left [ \sqr {(a_x^2+a_y^2+a_z^2)} \\ arccos(\frac{a_z}{\rho}) \\ arctan(\frac{a_y}{a_x})\right ]$$

and hence form the matrix M using the values of

$$\theta \ and \ \phi$$

Taking your values for the transformed vector A in the Cartesian system

xA=3sin(-7)cos(2)=0.8202
yA=3sin(-7)sin(2)=-1.792
zA=3cos(-7)=2.262

gives

$$\left [ \rho \\ \theta \\ \phi \right ]=\left [ \sqr {(x_A^2+y_A^2+z_A^2)} \\ arccos(\frac{z_A}{\rho}) \\ arctan(\frac{y_A}{x_A})\right ]=\left [ 3 \\ 0.717 \\ -1.14 \right]$$

So the matrix operation

$$\left [ \bf{M}\right ]\left [x_A \\ y_A \\ z_A \right]$$

with M deduced using values

$$\theta=0.717 \ and \ \phi= -1.14$$

should give back the original co-efficients of the spherical unit vectors.

But this isn't the case. One just gets the result ...

$$\left [ 3 \\ 0 \\ 0 \right ]$$

rather than the original coefficients

$$\left [ 3 \\ -7 \\ 2 \right ]$$

I suspect finding the equivalent coefficients of the unit Cartesian vectors corresponding to spherical vector A (given in the question) would be found from

$$\left [ Inverse(\bf{M}) \right ]\left [ 3 \\ -7 \\ 2 \right ]$$

Where M is deduced using

$$\theta=\frac{\pi}{2} \ and \ \phi= 0$$

as stated in the question for the origin of A in the spherical system

The result for the Cartesian "equivalent" of A would then be

$$A'=3\bf{\hat{x}}+2\bf{\hat{y}}+7\bf{\hat{z}}$$

In the same way the B vector would translate to

$$B'=-2\bf{\hat{x}}+-2\bf{\hat{y}}+4\bf{\hat{z}}$$

In this case using

$$\theta=\frac{\pi}{2} \ and \ \phi= \frac{\pi}{2}$$

to deduce M

in ...

$$\left [ Inverse(\bf{M}) \right ]\left [-2 \\ -4 \\ 2 \right ]$$

Last edited:

#### tquiva

Joined Oct 19, 2010
176
Thank you both for the given solutions. But I have a question for t_n_k:

What do you mean by "M deduced" ?

Is M a vector you're multiplying to the vector next to it?

#### t_n_k

Joined Mar 6, 2009
5,455
Clearly the two methods presented are different solutions with different answers - so take your pick as to which you think is correct.

$$\left[ \bf M \right ] =\left [ \begin{array}{cc} sin(\theta)cos(\phi) & sin(\theta)sin(\phi) & cos(\phi) \\ cos(\theta)cos(\phi) & cos(\theta)sin(\phi) & -sin(\theta) \\ -sin(\phi) & cos(\phi) & 0 \end{array}\right ]$$

You substitute the appropriate values of

$$\theta \ and \ \phi$$

into the elements of M to come up with a 3x3 matrix in this case.

So if

$$\theta=\frac{\pi}{2} \ and \ \phi=0$$

then the top left element of matrix M is given by

$$M(1,1)=sin(\theta)cos(\phi)=sin(\frac{\pi}{2})cos(0)=1$$

and so forth

#### t_n_k

Joined Mar 6, 2009
5,455
Returning to the original question. The required answer is the new vector A-B.

The problem arises when translating the Cartesian difference vector back to the spherical system is deciding where the resultant vector is to originate.

Presumably this would most likely be the same origin specified for spherical vector A in the question.

What are the options?

Firstly, if I use the same method outlined in post #14 for performing the translation I start with the Cartesian difference vector

$$A'-B'=5\bf{\hat{x}}+4\bf{\hat{y}}+3\bf{\hat{z}}$$

which translates to

$$A-B=7.071 \bf{\hat{\rho}}+0 \bf{\hat{\theta}}+0\bf{\hat{\phi}}$$

in the spherical system.

This tells me that the solution is non unique, with the resulting vector mapping out a sphere of radius 7.071. Not particularly useful!

If I place the same vector at the stated origin of vector A

NB: Using only the $$\theta$$ and $$\phi$$ values of that origin

the Cartesian difference vector translates to the spherical equivalent.

$$A-B=5\bf{\hat{\rho}}-3 \bf{\hat{\theta}}+4\bf{\hat{\phi}}$$

I'm not sure if this would be the required answer.

Joined Jul 7, 2009
1,583
One other problem here is that the spherical coordinate system isn't defined here, so there's some ambiguity -- what exactly are the angles θ and phi and their domains? These need to be defined because there are different conventions. The stated problem gives values for the spherical coordinates that are outside the typical domains -- for example, the conventions I've always used are the radial coordinate is >= 0, the azimuth is between 0 and 2*pi, and the angle off the z axis is between 0 and pi.

To summarize how I think this problem needs to be solved, the two vectors are assumed to be free vectors. Then you'd effectively use parallel transport to move one of them to the other vector so that their starting points coincide. Negate the vector being subtracted (B). Then add them as usual with the parallelogram law.

When you're studying such stuff for the first time, it helps to create some physical models -- that's why I encouraged the use of some wire to represent the vectors. You can get some square blocks of styrofoam or foam and use them to hold a wire of the requisite length at the desired orientation in space. Then place things on a piece of graph paper on a table top and you can have a coordinate system. Then it's easier to do things like the parallel transport, negating, etc. and see what's going on in space. This helps develop your ability to make mental pictures from the given conditions.

#### t_n_k

Joined Mar 6, 2009
5,455
The stated problem gives values for the spherical coordinates that are outside the typical domains -- for example, the conventions I've always used are the radial coordinate is >= 0, the azimuth is between 0 and 2*pi, and the angle off the z axis is between 0 and pi.
The stated origins for the vectors A & B fall within the typical domains you mention.

In your posted solution you seem to interpret the unit vectors $$\hat{\bf \theta}$$ and $$\hat{\bf \phi}$$ as angular rotations. Are the stated co-efficients of these unit vectors what you considered as being outside of the domain ranges? I believe the co-efficients of those unit vectors are normally interpreted as linear displacements.

In regard to the latter point I found this to be a useful link http://web.mit.edu/6.013_book/www/appendices/app1.html

Last edited: