# AndroidPathMeasure

Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/AndroidPathMeasure.android.kt+class:androidx.compose.ui.graphics.AndroidPathMeasure) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- android

  ```
  class AndroidPathMeasure : PathMeasure
  ```

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPathMeasure#getPosition(kotlin.Float)(distance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Pins distance to 0 \<= distance \<= getLength(), and then computes the corresponding position | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPathMeasure#getSegment(kotlin.Float,kotlin.Float,androidx.compose.ui.graphics.Path,kotlin.Boolean)( startDistance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, stopDistance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, destination: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path, startWithMoveTo: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Given a start and stop distance, return in dst the intervening segment(s). | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPathMeasure#getTangent(kotlin.Float)(distance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Pins distance to 0 \<= distance \<= getLength(), and then computes the corresponding tangent | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPathMeasure#setPath(androidx.compose.ui.graphics.Path,kotlin.Boolean)(path: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path?, forceClosed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Assign a new path, or null to have none. | android |

| ### Public properties |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPathMeasure#length()` The total length of the current contour, or 0 if no path is associated with this measure object. | android |

## Public functions

### getPosition

android

```
open fun getPosition(distance: Float): Offset
```

Pins distance to 0 \<= distance \<= getLength(), and then computes the corresponding position

| Parameters |
|---|---|
| `distance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The distance along the current contour to sample |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()` if there is no path set |

### getSegment

android

```
open fun getSegment(
    startDistance: Float,
    stopDistance: Float,
    destination: Path,
    startWithMoveTo: Boolean = true
): Boolean
```

Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD \>= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true.

### getTangent

android

```
open fun getTangent(distance: Float): Offset
```

Pins distance to 0 \<= distance \<= getLength(), and then computes the corresponding tangent

| Parameters |
|---|---|
| `distance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The distance along the current contour to sample |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()` if there is no path set |

### setPath

android

```
open fun setPath(path: Path?, forceClosed: Boolean): Unit
```

Assign a new path, or null to have none.

## Public properties

### length

android

```
open val length: Float
```

The total length of the current contour, or 0 if no path is associated with this measure object.