Created
September 3, 2018 07:13
-
-
Save williwambu/e952524653cf08c873330306de4a28e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get two close points | |
const point1 = path.getPointAtLength(distance); | |
const point2 = path.getPointAtLength(distance + 1); | |
// Get angle(radians) | |
// Convert to degrees | |
const angle = Math.atan2(point1.y - point2.y, point1.x - point2.x) * (180 / Math.PI); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment