Last active
September 29, 2022 13:31
-
-
Save nikhil-mandlik-dev/83e24725f7633d98157486029ae4cdc1 to your computer and use it in GitHub Desktop.
Finding the position of each coordinate along a path π
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
val pos = FloatArray(2) | |
val tan = FloatArray(2) | |
PathMeasure().apply { | |
// set infinity path for which we want to do the calculation | |
setPath(infinityPath.asAndroidPath(), false) | |
// get the position and tangent of co-ordinate on the path | |
getPosTan(distance, pos, tan) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment