Skip to content

Commit

Permalink
fixup! Add an angle() method
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed Oct 11, 2018
1 parent f0c9b28 commit 3b22df1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ Rotate a vector in relation to its own origin and return a new `Vector2`.

Positive rotation is counter/anti-clockwise.

#### angle(vector)

Compute the angle between two vectors, expressed as a scalar in degrees.

>>> Vector(1, 0).angle(Vector(0, 1))
90

As with `rotate()`, angles are signed, and refer to a direct coordinate system
(i.e. positive rotations are counter-clockwise).

#### normalize()

Return the normalized `Vector2` for the given `Vector2`.
Expand Down

0 comments on commit 3b22df1

Please sign in to comment.