Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That seems pretty surprising to me. The lower level/physics books I've seen introduce the dot product with both a geometric and algebraic definition, and show they're equivalent in 2-3 dimensions. The "how" is the algebraic definition and the "why" is the geometric definition.

It's not really that it measures similarity. Physics isn't interested in that. It's that it tells you lengths and angles, which you need in all sorts of calculations. In more advanced settings, a dot product is generally taken as the definition of lengths and angles in more abstract spaces (e.g. the angle between two functions).

In machine learning applications, you want a definition of similarity, and one that you could use is that the angle between them is small, so that's where that notion comes in. A more traditional measure of similarity would be the length of the difference (i.e. the distance), which is also calculated using a dot product.



Angle is a measure of similarity (well, distance/nearness).

In physics, the dot product is used to losslessly project a vector onto an orthonormal basis, and the angle measures how much of the vector's magnitude is distributed to each bases vector.

The angle can be defined in terms of the dot product, because you don't need the angle (as in a uniform measure of rotation) in order to compute important physical results.


Angle is one way to measure similarity. A more natural one in most settings is distance. In any case, physics isn't really concerned with similarity.

The angle can be defined in terms of dot product because |a|=sqrt(a•a) can be shown to be a norm, and because a•b/|a||b| can be shown to always be between -1 and 1, and because those things agree with length and cosine of the angle for Euclidean spaces. It's not that you don't need the angle. It's that the dot product gives a good definition of angle in settings where it's otherwise not clear what it would be (e.g. what's the angle between two polynomials `x` and `x^2`)

In programming terms, there are interfaces for things like length and angle (properties that those things should satisfy). If you implement the dot product interface, you get implementations of those other ones automatically. The "autogenerated" implementations agree with the ones we'd normally use in Euclidean geometry.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: