Skip to content

Commit

Permalink
Update AngleBetweenVectors.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySarnoff committed Jul 18, 2020
1 parent 7cf75e0 commit 72671c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/AngleBetweenVectors.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
module AngleBetweenVectors

export arc

import Base: angle

import LinearAlgebra: norm


@inline unitize(p) = p ./ norm(p)

function arc(point1::NTuple{2,T}, point2::NTuple{2,T}) where {T<:Real}
return atan(point1[2], point1[1]) - atan(point2[2], point2[1])
end

"""
angle(point1::T, point2::T) where {T}
Expand Down

0 comments on commit 72671c9

Please sign in to comment.