---
title: "init(frameAnalysisSpacing:trajectoryLength:completionHandler:)"
framework: vision
role: symbol
role_heading: Initializer
path: "vision/vndetecttrajectoriesrequest/init(frameanalysisspacing:trajectorylength:completionhandler:)"
---

# init(frameAnalysisSpacing:trajectoryLength:completionHandler:)

Creates a new request to detect trajectories.

## Declaration

```swift
init(frameAnalysisSpacing: CMTime, trajectoryLength: Int, completionHandler: VNRequestCompletionHandler? = nil)
```

## Parameters

- `frameAnalysisSpacing`: A doc://com.apple.documentation/documentation/CoreMedia/CMTime value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to doc://com.apple.documentation/documentation/CoreMedia/CMTime/zero to analyze all frames.
- `trajectoryLength`: The number of points required to analyze to determine that a shape follows a parabolic path. This argument value must be at least 5.
- `completionHandler`: A closure that’s invoked after the request completes its processing. The system invokes the completion handler on the same dispatch queue that the request uses to perform its processing.
