# Dot product of two vectors without a common origin

Given two unit vectors $v_1, v_2\in R^n$, their dot product is defined as $v_1^Tv_2=\|v_1\|\cdot\|v_2\|\cdot\cos(\alpha)=\cos(\alpha)$. Now, suppose the vectors are in a relation $v_2=v_1+a\cdot1_n$, i.e., the vectors are parallel(one is the shifted version of another), where $a\in \mathbb{R}$ is a constant and $1_n=[1 \dots 1]\in\mathbb{R}^n$ is a vector of all ones. Dot product would now be $$v_1^Tv_2=v_1^T(v_1+a\cdot1_n)=1+a\cdot v_1^T1_n \tag 1.$$ This implies that by shifting the vectors, the dot product changes, but still $v_1v_2=\cos(\alpha)$, where the angle now has no meaning. Does that imply that, to perform the proper angle check between two vectors one has to center them (average of vector entries is zero for both vectors, which would be one option)? If so, what does this imply geometrically? Are vectors brought to the same origin this way?

Another, more interesting observation is with $v_1, v_2$ being unit eigenvectors of two diffrent matrices. From (1), it can be concluded that when the vector entry sum is zero (vectors are centered), the origin is shared (?). For which matrices is it the case that the eigenvectors are centered, ie., with the eigenvector entry sum of zero? For instance, with the matrices having $1_n$ as an eigenvector, by virtue of orthogonality, the sum of entries for each other eigenvector is 0. Are these the only kind of matrices with this kind of the eigenvector property?

-

In an affine space we can "forget" about the origin, in the sense that it is determined by arbitrary choice of coordinates and so isn't a distinguished part of the space itself. This space has points, and between points we can draw arrows to describe direction. These "arrows" are vectors, and the set of all vectors forms a vector space: an algebraic structure where addition makese sense and scalar multiplication by elements from a given field (the real numbers here) too. There is a vector which is the additive inverse, zero. The vectors act on the points in the affine space by translating them from one location to another, according to the direction and magnitude of the vector. This should all be known already, but it is key that at first the affine space and vector space are two different things.

The vector space has an origin distinguished by being the additive identity, but we can take a copy of this vector space and then interpret the vectors as points, and then the arrows that exist between two points is the original vector that needed to be added algebraically to go from one to the other; we can keep the origin as part of a particular coordinate system. In this way we can view a space as both a vector space and an affine space simultaneously!

It gets a little tricky when we want to describe geometry though. Two vectors standing on an affine space are parallel if they point in the same direction, with no restrictions on their base point. On the other hand, if we want to view these parallel vectors in their vector space habitat as arrows they must be arrows pointing from the origin. The inner product is an operation on the vector space, so if we have two vectors in affine space we want to dot together we do have to "center" them in this way so that the angle-between-them interpretation remains valid.

We can translate vectors on the affine space (move them around without changing their direction) and they remain the same vector, just with a different base point. The operation of addition on the vector space however results in a new vector (when the summands are nonzero), and moreover adding two nonparallel vectors results in a vector that is not parallel with either of the original two.

What we can say instead is that if we have the zero vector $0$, a vector $v$, and a translation vector $w$, we can interpret $0$ and $v$ as points and the arrow between them will of course be the vector $v$, while if we translate the points $0$ and $v$ by the vector $w$ we will obtain the points $w$ and $v+w$ respectively (we must be careful about which we call vectors and which we call points!), The vector between these latter two points will again be $v$, which is obviously parallel to our original vector (because they are one and the same vector).

If $p$ is a vector we reinterpret as a point, and $v$ a vector in affine space with base point $p$, then the vector $v$ understood as an arrow will point specifically to the point $p+v$ (remember the addition takes place in the vector space, so to understand this we have to go back to the vector interpretation of $p$, add to $v$, and then forward again to the affine interpretation as a point). The point $p+v$ corre-sponds to the original vector $p+v$, so the "centering" process involves taking the point $p$ back to the origin (associated to the zero vector) as well as the point $p+v$ back to the point $v$, which is done by subtracting out the vector $p$. In other words, to center a vector existing in affine space, we take the point that it points to as an arrow, interpret it as a vector and subtract out the vector associated to the original base point. This is conceptually a rather roundabout process, but it's what goes on.

Moreover, there is nothing special about the vector $1_n:=(1,\cdots,1)$ when it comes to centering; it does shift every component by $1$ when added to a vector but generally this doesn't center anything at all. Translating a point in affine space just moves it in some specific direction, and indeed there is nothing inherently special about this direction; if we change our coordinate system the component form of this vector could be almost anything we want it to be.

What does it mean when the sum of the components of a vector is zero? (First, keep in mind this sum depends on the choice of coordinate system, so is not intrinsically a function of just the vector space. This is because what vector "$1_n$" specifies depends on coordinates.) It means the dot product between $v$ and $1_n$ is zero, so they are orthogonal aka perpendicular. Thinking of matrices as linear transformations of a vector space (given coordinates) then allows us to use this information to characterize the matrices (with eigenvectors' entries summing to zero) in a geometric way.

-
I would appreciate if you could edit your answer to account for the second part of the question. Thanks. –  user506901 Apr 24 '12 at 11:10
Thanks. An example of the "centering" and determining the angle with samples $v1=[2~3~−1]^T$ and $v_2[3~4~0]^T$ would remove the ambiguity. –  user506901 Apr 24 '12 at 13:26

There is no such thing as "shifting the vectors".

There is a space of points (e.g. ${\mathbb R}^n$). When once considers all formal differences between the points (such as $(x, y)$; the differences could be seen as the arrows with the start in $x$ and end in $y$) and factors them under the shift relation (that is, $(x, y)$ is considered to be equal to $(z, 0)$ if $x = y+z$ when you consider this points as $n$-tuples of numbers in $\mathbb R$ with the addition defined coordinate-wise), they get a space of vectors (you can think of it as of the arrows with the start in $0$ and the end somewhere).

The dot product is defined for two vectors (or, alternatively, two arrows originating from zero). What you're calling a "shift" is shifting the end point of the arrow; but the start point remains the same it was - a zero ($0$). So, after your "shift" you're getting the completely different vector; of course, it will form a completely different angle to some fixed vector when compared to an original value.

Or, alternatively, you might define a "shift" as shifting both start and end points of vector. But the coordinates used in a dot product are the coordinates of the end point for the start point in zero, so that coordinates do not change, and the dot product doesn't change as well.

-
I understand that; I just tried to communicate what I meant. In any case, this way I clarify the point that confuses my interpretation. –  user506901 Apr 24 '12 at 8:36
"Does that imply that, to perform the proper angle check between two vectors one has to center them" - again, you can get the angle between vectors from a dot product; but the formula to calculate a dot product pointwise accepts coordinates of the end points of the vectors where the start point is at zero. It makes no sense to use the formula $v_1^Tv_2$ where you're substituting the coordinates of the end points as $v_1$ and $v_2$ where the start points are not fixed at zero. –  penartur Apr 24 '12 at 8:39
"However, I'm interested in the implications with v2=v1+a⋅1n" - what is $1_n$, and what is $a$? –  penartur Apr 24 '12 at 8:40
Thanks. I've edited the question. So, there is no sense to define to define $v_1^Tv_2$ if the vectors are not centered (share the common start point)? I hope you'll be able to consider the second part of my question, relating to the eigenvectors. –  user506901 Apr 24 '12 at 8:47
Yes. $v_1^Tv_2$ is defined for the $n \times 1$ matrices, and you have vectors, so you should get the matrix by the vector somehow. The corresponding matrix would contain the difference between the $i$th coordinates of the end and the start point (or the $i$th coordinate of the end point, if the vector starts at zero). As for the second part of your question, it is not clear what were you trying to say. For example, $1_n$ usually denotes the identity element in the $n \times n$ matrices algebra, and you're using it as if it were a vector. –  penartur Apr 24 '12 at 8:55

My first answer would be that scalar products are defined in vector spaces. You are actually thinking of $\mathbb{R}^n$ as an affine space. To be more explicit, in a vector spaces the concept of parallelism is this: two vectors $v$ and $w$ anre parallel if and only if $v=cw$ for some scalar $c$. Thinking geometrically, a dot product should be independent of affine translations (if you really want to consider them).

-
Thanks. However, I'm interested in the implications with $v_2=v_1+a\cdot 1_n$. What happens with the dot product then, and what is the geometric interpretation? Are there eigenvectors $v_1, v_2$ of two different matrices for which $v_1^Tv_2=1$? –  user506901 Apr 24 '12 at 8:39
Assume $v=(v_1,v_2)\in \mathbb{R}^2$ and $w=(w_1,w_2) \in \mathbb{R}^2$, for simplicity. You are interested in the case $(w_1,w_2)=(v_1,v_2)+(a,a)=(v_1+a,v_2+a)$. Then $\langle v,w \rangle = v_1(v_1+a)+v_2(v_2+a) = v_1^2 +av_1 + v_2^2+av_2=|v|^2+a(v_1+v_2)$. But keep in mind that $(v_1+a,v_2+a)$ is not an affine translation of $(v_1,v_2)$; it is just a vector with different coordinates, but always considered as a geometric vector from the origin of the axes. –  Siminore Apr 24 '12 at 9:26

As others have pointed out, a vector shouldn't be thought of as a 'line' through space, which may or may not go through the origin. Vectors should instead be thought of as lines that go from zero to a given point. Indeed, there is no real difference between a vector and a point - you give me a point, I can give you one (and only one) vector which ends at that point, and likewise if you give me a vector I can give you one (and only one) point corresponding to that vector - it's 'endpoint'. There's a one-to-one correspondence between vectors and points in space!

For a more concrete example, consider the vector $[2,4]$ and the vector $[3,5]=[2,4]+[1,1]$. These are both plotted here, and you can see that they are not parallel. The only vectors parrallel to $[2,4]$ would be $[1,2]$, $[3,6]$ and more generally, $\alpha[1,2]$ for any real $\alpha$.

-
Thanks for the illustration. My notion of parallel was inappropriate; I actually thought of moving both the start and end point with the same translation parameter; this would just move the vector out of the origin, and that is why I thought of it as parallel. Note that the "vectors" I work with share no common origin. Therefore, to properly consider a vector dot product, I center them (sum of entries of each is zero), and then I perform the dot product (and I can determine the angles). I guess that makes sense. –  user506901 Apr 24 '12 at 9:40