# `GSPath nearestPoint(to:)`

*Instance Method*

Finds the point on the path nearest a point.

## Declaration

```swift
func nearestPoint(to location: CGPoint) -> (point: CGPoint, pathTime: CGFloat)?
```

## Return Value

The nearest point and its path time, or `nil` when no nearest point can be determined.

## Discussion

A path time identifies a position within a path segment. Its integer part is the index of the ending on-curve node, and its fractional part is the position within the segment.

## See Also

### Path Time

- [`GSPath point(atPathTime:)`](/Core/GlyphsCore/GSPath/point(atPathTime:)) — The point at a path time, or `nil` when the path time does not identify a position on the path.
- [`GSPath nearestNodeWithPathTime:`](/Core/GlyphsCore/GSPath/nearestNodeWithPathTime:) — Returns the on-curve node nearest a path time.

