Talk:Dot product

message: In 2D and 3D Euclidean space, the scalar product a.b between vectors a and b was defined for me as |a||b|cos@. If you use an orthonormal basis then it can be shown that a.b = (a1, a2, a3).(b1, b2, b3) = a1b1 + a2b2 + a3b3, where (x1, x2, x3) means x1e1 + x2e2 + x3e3 where {ei} is an orthonormal basis (and the xi are scalars).
However, for any other basis, the scalar product will NOT turn out to be the sum of the products of the components with respect to the basis, i.e. will not equal a1b1 + a2b2 + a3b3. However this is how the scalar product is defined by the article.
What is the resolution of this apparent contradiction? --81.152.176.225 (talk) 17:46, 30 March 2011 (UTC)
replies: text: Your confusion is between the notions of inner product an dot product (at least as they are used here; their meanings are not always well distinguished). A Euclidean space comes equipped with an inner product. It is related to the norms of vectors and the cosine of the angle as you indicated, although I would say this defines the angle rather than the inner product. As defined here, a dot product is just an algebraic expression in terms of entries, like the determinant of a matrix (but a different expression of course). It happens that Euclidean spaces always have (many) orthonormal bases, and that in terms of the coordinates on a given orthonormal bases the inner product is given by the dot product of the respective coordinates. In terms of coordinates on other bases this is not the case, but that is no contradiction, it is actually more of a surprise that it is given by the very same expression in terms of coordinates of any orthonormal bases (in general changing coordinates also changes the expressions for functions of the coordinates). As Euclidean spaces are often identified with Rn (in which case the dot product of the vector entries is an inner product), the notions are sometimes confounded, but this should not really be done (and I'm not sure to which one of the two "scalar product" should refer; I think inner product would be the most appropriate). The dot product is defined here in such a manner that the phrase "a coefficient of a matrix product is given by the dot product of a row of the left matrix and a column of the right matrix" makes sense; in this case there is no Euclidean space or inner product involved at all. Hope this helps. Marc van Leeuwen (talk) 17:29, 31 March 2011 (UTC)
replies: text: The deeper issue here is that a vector space alone does not have any concept of orthogonality or length. For a finite dimensional vector space over the reals, if we take any basis, then we can define the scalar product relative to that basis. The basis will be orthonormal relative to the scalar product defined from that basis; the lengths and angles between other vectors are again only relative to the choice of basis, and they can be found using the usual formulas and the scalar product for that basis. — Carl (CBM · talk) 23:24, 30 June 2013 (UTC)
replies: text: To be as general as possible maybe it makes sense to define the dot product by using the metric tensor. In a general non-orthonormal basis the dot product is given as: u \cdot v = \sum_{i,j} u_i v_j (\vec{e}_i \cdot \vec{e}_j) = \sum_{i,j} u_i v_j g_{i,j}. Then one may argue that for an orthonormal basis the metric tensor is the identity so the simpler formula is retrieved. Length and angles are invariant to change of bases. As it is currently written, the formula is correct only for orthonormal bases. Vassillen (talk) 11:18, 22 June 2020 (UTC)
replies: text: You are talking about the inner product, of which the dot product is a specific case. D.Lazard (talk) 11:24, 22 June 2020 (UTC)
replies: text: The dot product is the inner product in Euclidean space as noted in the article on the inner product. You can pick any basis for the N-dimensional Euclidean space. And in the case of a non-orthonormal basis (an Euclidean space, but not the standard Euclidean space) the current definition does not work. The main issue here is that the way length and angles are measured is not invariant to change of basis anymore. I believe that it should be mentioned somewhere at the very least, before one introduces the assumptions about the orthonormality of the basis. Vassillen (talk) 11:39, 22 June 2020 (UTC)

text: This seems to be mainly a contention about the meaning of the dot/scalar product. A definition can be found in: "Аналитическая геометрия, Том 1", Б. Н. ДЕЛОНЕ и Д. А. РАЙКОВ, 1948 (Boris Delaunay, see Books). The definition can be found in 1.2.9, specifically the definition is introduced through \vec{a}\vec{b} = \|a\|\|b\|\cos\theta. Later on the algebraic definition is derived from linearity, and the explicit general form using the metric tensor can be found in: 1.2.11.2. Vassillen (talk) 13:21, 22 June 2020 (UTC)
thread_title:  Regarding bases 

message: ...since this section doesn't say much at all. All the info is in the main articles tensor, tensor contraction. It would be better to briefly include various other generalizations such as weight functions, inner products on functions, dot products in matrices and dyadics... which are not mentioned, in additon to complex vectors and tensors.Maschen (talk) 20:24, 25 August 2012 (UTC)
thread_title:  Remove section [[Dot product#Generalization to tensors|Dot product, Generalization to tensors]]... 

message: Following my major revision of the article, I thought I should summarize here the most important points of my edit, and highlight what I think still needs to be done.
* My chief concern in the sequence of edits was the demands of WP:NPOV, that we should give equal weight to the two different definitions of the dot product: the geometric and algebraic one.  The earlier revision of the article took for granted that the dot product should be defined algebraically in terms of the components of a vector.  As a result, the article had to worry about things like coordinate dependence and orthonormal bases.  This is generally a bad way to define the dot product for that reason.  That is why in physics/tensor analysis, the dot product is defined in a coordinate-independent manner at the outset, and its algebraic properties are then deduced.  Of course, in much of applied mathematics, the dot product is just defined componentwise.  That's fine, but it seems like we should present both points of view in parallel.  It simplifies much of the discussion I think.
* I have removed the section on Rotations.  This was so badly written that it completely failed to convey the relevant point: that the dot product is invariant under rotations.  That is something that should be mentioned in the "Properties" section (which also needs to be taken in hand and organized a bit better).  It is a trivial consequence of the geometric definition of the dot product (!) that doesn't require matrices to explain.
* I have added a more intuitive proof sketch of the equivalence of the algebraic and geometric definitions using the scalar projection.  In doing so, I have unfortunately removed the connection with the law of cosines.  This should probably be mentioned somewhere in the article, but it was not particularly enlightening where it was anyway, situated in the middle of a very dull proof that no one was going to read.
* I removed the paragraph from the lead that stated: "In Euclidean space, the inner product of two vectors (expressed in terms of coordinate vectors on an orthonormal basis) is the same as their dot product. However, in more general contexts (e.g., vector spaces that use complex numbers as scalars) the inner and the dot products are typically defined in ways that do not coincide."  This is misleading because many many authors define the dot product geometrically in Euclidean space rather than in terms of components in an orthonormal basis.
* I shortened the discussion of the scalar product and geometric definition.  This section managed to drag on without saying anything substantive.
--Sławomir Biały (talk) 15:52, 25 November 2012 (UTC)
replies: text: Thanks, a massive improvement. Maschen (talk) 16:12, 25 November 2012 (UTC)

text: If it's ok I added the cosine law to the end of the properties section. Maschen (talk) 17:02, 25 November 2012 (UTC)
replies: text: Good idea.  Sławomir Biały (talk) 18:09, 25 November 2012 (UTC)
thread_title:  Recent edits 

message: I edited the properties section without realizing Quondum's edit before:
:"The cross product can also produce a vector (when the inputs are a vector and a pseudovector); is this worth getting into in this article?)"
I would say no since this article is about the dot product, not the cross... 
Hope my changes to the properties section are ok - it is harder or clearer to read? M∧Ŝc2ħεИτlk 18:20, 14 December 2012 (UTC)
thread_title:  More recent edits 

message: IMHO, this page assumes a high level of comfort with mathematical terminology.
As a software writer, using computer graphics, I was looking for confirmation of the simple case of dot product for a vector in (x,y):
"(x1,y1) dot (x2,y2) = (x1*x2 + y1*y2)"
I presume the Algebraic section confirms that. But it would take me too long to think through what it is saying. (So I looked elsewhere.)
I suggest this example to anyone who might be thinking "this page could be made more accessible"...  ToolmakerSteve (talk) 06:37, 5 February 2013 (UTC)
replies: text: +1.  With a diagram where the dot product is identified. Jordan Brown (talk) 21:30, 2 September 2017 (UTC)
thread_title:  IMHO, A simple 2D example of the algebraic formula would make this page useful to a wider audience 

message: §Properties currently reads:
*Invariance under isometric changes of basis
Ignoring the dispute about the algebraic definition, the geometric definition is invariant under any change of basis, exactly as it should be.  Any definition of the dot product that produces a value that could vary with a change in basis is simply insane.  Why is there any restriction placed on the change of basis?  — Quondum 22:32, 30 June 2013 (UTC)
replies: text: I am new to this particular article, but it seems to me that if we divide all the components of a vector by 2 (which corresponds to a certain change of basis) then the dot product of that vector with itself will not usually remain the same, if the dot product is defined (as I assume it is) in terms of the components. Really the issue is that the dot product is only defined in that sense relative to a basis, and then "invariance" is just jargon for a theorem that two bases which are isometric with respect to each other (whatever that means...) will give the same values for all dot products. Actually, I am not certain exactly what an "isometric change of basis" is supposed to be. One possibility: if the new basis gives every vector the same length as the old basis, then by the Parallelogram law the two dot products have to be the same. — Carl (CBM · talk) 23:19, 30 June 2013 (UTC)

text: There used to be a paragraph in the lede that clarified what was going on, but it was removed in this edit: . As that paragraph used to explain, the dot product defined in terms of components in an arbitrary basis is not, in general, the same as the inner product of two vectors in \mathbb{R}^n, which is the special case of the dot product in the standard basis. — Carl (CBM · talk) 23:53, 30 June 2013 (UTC)
replies: text: That removed paragraph maybe does not clarify much. However what you might be reading from it is that the dot product is defined on the coordinate vector representing an abstract vector in terms of a basis.  In this picture, the original vector and the basis are not relevant, and we are dealing with a linear transformation of coordinate vectors.  The section would have to be updated to Invariance under isometric linear transformations, though this is a tautology: an isometry is defined as a transformation that preserves the dot product. — Quondum 00:24, 1 July 2013 (UTC)
replies: text: Because any coordinate-free definition of the dot product is (as you said originally) preserved under every isomorphism, for that definition of an isometry to make sense, the dot product has to be defined relative to a basis in a way that makes essential use of the specific coordinates. The geometric definition is such a definition: it is just a special case of the coordinate-based dot product relative to a particular basis (the standard basis). — Carl (CBM · talk) 00:30, 1 July 2013 (UTC)
replies: text: Okay, so we define the dot product as a sum of products of corresponding (real) coordinates of two tuples.  Then you identify a map onto Euclidean space so that the original tuple happens to be equal to the coordinate vector of each Euclidean vector relative to some basis, as well as this basis being orthonormal.  Fine, you can do this.  The dot product then matches the Euclidean length (we'll ignore such inconvenient things such as units for now).  The problem comes in with the implicit pull-back (well, I think you call it that) of properties such as scalar multiplication and vector addition: you added these properties when you did the mapping.  You do not have these properties without the mapping, or defining them on the original space of tuples.  You also do not have the concept of a basis without these properties.  — Quondum 01:02, 1 July 2013 (UTC)
replies: text: If I have \mathbb{R}^n as an abstract vector space (i.e. I have a vector space over \mathbb{R} of dimension n but I know nothing else about the space) then I already have scalar multiplication and vector addition, because I have a vector space. But I have no dot product or inner product, because I just have an abstract vector space. One way to define an inner product on my space is to choose any basis for the space (the definition of a basis is coordinate-free, and a basis exists for each vector space), so that I can write a coordinate tuple for each vector relative to the basis. Then I can define an inner product on the original space to be the dot product on the coordinate tuples of the two vectors. Now I can ask: for which pairs of bases B, B′ do I obtain the same values for all these dot products from B and from B′? One answer is that if B and B′ give every vector the same length (i.e the dot product of every vector with itself relative to B is the same as the dot product with itself relative to B′) then all the dot products will be equal under B and B′. That is what the original sentence says to me. The key point is that the dot product of two vectors is only defined relative to a choice of basis, when all I know about the vectors is that they belong to an abstract copy of \mathbb{R}^n. — Carl (CBM · talk) 01:31, 1 July 2013 (UTC)

text: I don't think this distinction between "elementary" and "categorical" is right.  As a categorical product \mathbf R^n is equipped with n projection maps into \mathbf R.   This is all we need to define the dot product. Sławomir Biały (talk) 02:00, 1 July 2013 (UTC)
replies: text: Each individual copy of \mathbb{R}^n has projections, but there is no unique space that "is" \mathbb{R}^n in the category of vector spaces over \mathbb{R}. So there is an element of arbitrariness in choosing one particular space to call "\mathbb{R}^n", which is the same as the arbitrariness of choosing a basis. But in any case my point is that the original article was written from a viewpoint where a vector space does not come equipped with a basis - including \mathbb{R}^n - while the present version assumes that \mathbb{R}^n is a specific space of tuples. Either approach is fine with me, but it helps if everyone realizes which approach is being taken, because it will affect the way that the material is presented. — Carl (CBM · talk) 02:15, 1 July 2013 (UTC)
replies: text: I still think this is a false dichotomy.  Surely defining a dot product requires that we work in \mathbf R^n, not in a vector space that is abstractly isomorphic to \mathbf R^n.  The latter would more properly be called an inner product (perhaps an inner product induced by the isomorphism), but not the dot product.  See, for instance, the text "Linear algebra" by Greub.  He uses the term "standard inner product" to refer to the dot product on \mathbf R^n and then discusses the induced inner product in a basis as a completely different case referring to it as an "inner product".  Sławomir Biały (talk) 12:04, 1 July 2013 (UTC)
replies: text: We both agree that the "dot" product requires working with tuples of real numbers. The distinction is whether \mathbb{R}^n is defined to be the set of such tuples, as is common in elementary settings, or is instead a more abstract structure. In the former case, because vectors are defined as tuples, we can define the "dot product of two vectors" by referring directly to the tuples, or by identifying the vectors with geometric objects and referring to their length. In the latter case, when a "vector" does not come pre-equipped with components, it is impossible to define the "dot product of two vectors", only "the dot product of two vectors relative to a basis". The latter is exactly the induced inner product on a basis. In this more abstract setting, for example, the "angle" between two vectors is only defined after we pick (arbitrarily) an inner product, the angle is not an inherent property of the vectors themselves. (The same distinction would come if we treated \mathbb{R}^n as an affine space: if \mathbb{R}^n is the set of tuples then we know which vector is "really" zero, but if \mathbb{R}^n is presented as an abstract affine space we have no way to tell.) — Carl (CBM · talk) 13:02, 1 July 2013 (UTC)
replies: text: Then I think the point is not that there is a problem with the meaning of \mathbf R^n, but rather what "Euclidean space" signifies.  Then I would agree that there is an elementary notion of Euclidean space (one that satisfies the axioms); an elementary model of Euclidean space: the "Cartesian model" \mathbf R^n equipped with the usual metric; and a less elementary model of Euclidean space: an inner product space.  Sławomir Biały (talk) 19:44, 1 July 2013 (UTC)

text: Back on topic: I have removed the property under discussion.  It seems to me that this is already mentioned in a more appropriate context at the end of the section on the equivalence of the two definitions.  Sławomir Biały (talk) 12:25, 1 July 2013 (UTC)
thread_title:  Constraint on basis transformation for invariance of the dot product 

message: 1. It is not clear how "Scalar projection" and "equivalence of the definitions" are related. 
2. It is not clear where discussion of scalar projection ends and proof of equivalence begins. 
3. It is not clear how :\mathbf A\cdot\mathbf B = \sum_i B_i(\mathbf A\cdot\mathbf e_i) follows. 
Furthermore, the section does not start with the trig definition and end with algebraic definition, or visa versa. So where is the equivalence?
I'm addressing this to whomever reverted my changes from 2013-07-27, which were an improvement. You know who you are. Terse mathematics is fine for research papers and dissertations where the reader is expected to be an expert and math is a common language. But "Dot product" is not advanced mathematics. This subject can and should be readily accessible by first year college students who have never had course in abstract algebra and probably never will. So please step down off your high horse and join us peasants laboring in the fields. You may not be a smart as you think.  — Preceding unsigned comment added by ThomasMcLeod (talk • contribs) 02:01, 2 August 2013 (UTC)
thread_title:  Section on "Scalar projection and the equivalence of the definitions" is jumbled and missing steps 

message: See the discussion here. Jarble (talk) 02:57, 6 January 2015 (UTC)
thread_title: This article appears to contradict another article

message: I had a question about the formula shown with the illustration. It shows theta = arccos(x DOT y / |x| |y|).
Should it be theta = arccos(x DOT y / (|x| |y|)) ?  — Preceding unsigned comment added by 2601:280:5B7F:F890:2948:8B9C:53B:6F2 (talk) 15:14, 23 September 2019 (UTC)
replies: text: You are right, but it is difficult to edit figures. Moreover, as formatted, I doubt that anybody would interpreted wrongly the formula. Also, in the case of a doubt, it is easy to look at the test of the aricle. D.Lazard (talk) 16:05, 23 September 2019 (UTC)
thread_title: Text in the figure

message: I agree with 's removal of 's edits. No one calls applying the metric tensor to two vectors a "dot product" in all but the Euclidean case. It also must be noted that this does not have the usual properties of a dot product when the manifold isn't Riemannian. Note too that there is not just one choice of metric on a finite-dimensional real vector space, since scaling the Euclidean metric by any positive constant factor yields another positive-definite quadratic form. We need a reliable source that uses the term "dot product" in this manner. It is also confusing to implicitly use raising and lowering indices without explaining what it is, which would leave our readers scratching their heads unless they already know differential geometry. Finally, the text as-written contained numerous grammar errors (often missing definite articles). All of these must be addressed before this can be reinserted.--Jasper Deng (talk) 07:58, 19 February 2020 (UTC)
thread_title:  Curvilinear case 

message: I don't see a valid proof.  The equivalence depends on homogeneity and distributivity of the geometric definition, which are not proved or justified.  Zaslav (talk) 07:41, 13 April 2023 (UTC)
thread_title:  Equivalence of definitions 

message: This page is great and informative. Though, I've seldom seen such stark and oversaturated colors in the definition of a mathematical concept. The edit in the history justifies the colors to "improve readability of the algebraic definition", but I don't think that the straightforward coordinate definition of a dot product necessitates this. Moreover, I feel the minor inconsistencies and arbitrary choices of what is colored adds confusion to the definition. I don't mind how it's done in the Law of Cosines section as a corresponding colored diagram is present, but I think I'm going to strip the colors in the coordinate definition unless anyone has strong feelings or can convince me otherwise. ^_^ EuclideanSwag (talk) 23:22, 6 May 2023 (UTC)
replies: text: if anyone cares I did this. There's a few sentences in the article I'd also like to clean up later. :3 EuclideanSwag (talk) 22:40, 29 May 2023 (UTC)
thread_title:  color usage 

message: It will come handy if someone is trying to understand the dot product. Yuthfghds (talk) 05:18, 9 September 2023 (UTC)
thread_title:  θ =cos^ -1 ( vec a . vec b /| vec a || vec b | )