Skip to content

Instantly share code, notes, and snippets.

@nikhil-mandlik-dev
Last active September 29, 2022 13:31
Show Gist options
  • Save nikhil-mandlik-dev/83e24725f7633d98157486029ae4cdc1 to your computer and use it in GitHub Desktop.
Save nikhil-mandlik-dev/83e24725f7633d98157486029ae4cdc1 to your computer and use it in GitHub Desktop.
Finding the position of each coordinate along a path πŸ”
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