Hacker News new | ask | show | jobs
by lupire 790 days ago
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.

1 comments

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.