Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySarnoff authored Dec 19, 2018
1 parent 7335cad commit 7821057
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@


[AngleBetweenVectors](https://github.com/JeffreySarnoff/AngleBetweenVectors.jl) exports `angle`.
`angle(point1, point2)` determines the angle of their separation. The smaller of the two solutions is used. `π` obtains If the points are opposed, [(1,0), (-1,0)]; so `0 <= angle(p1, p2) <= pi`. The same holds for `fastangle`.
`angle(point1, point2)` determines the angle of their separation. The smaller of the two solutions is used. `π` obtains If the points are opposed, [(1,0), (-1,0)]; so `0 <= angle(p1, p2) <= pi`.

This function expects two points from a 2D, 3D .. ManyD space, in Cartesian coordinates. To use another point representations, just define a `Tuple` constructor for it. Vectors, NamedTuples and SVectors have this already.
This function expects two points from a 2D, 3D .. ManyD space, in Cartesian coordinates. Tuples and Vectors are handled immediately (prefer Tuples for speed). To use another point representations, just define a `Tuple` constructor for it. NamedTuples and SVectors have this already.

Most software uses `acos(dot(p1, p2) / sqrt(norm(p1) norm(p2))` instead. While they coincide often; it is exceedingly easy to find cases where `angle` is more accurate and then, usually they differ by a few ulps. Not always.

Expand Down

0 comments on commit 7821057

Please sign in to comment.