Re-represent each trajectory spatially using a constant number of points so
that adjacent points on the trajectory become equidistant to each other.

```
mt_length_normalize(
data,
use = "trajectories",
dimensions = c("xpos", "ypos"),
save_as = "ln_trajectories",
n_points = 20
)
```

## Arguments

- data
a mousetrap data object created using one of the mt_import
functions (see mt_example for details). Alternatively, a trajectory
array can be provided directly (in this case `use`

will be ignored).

- use
a character string specifying which trajectory data should be
used.

- dimensions
a character string specifying which trajectory variables
should be used. Can be of length 2 or 3 for two-dimensional or
three-dimensional data.

- save_as
a character string specifying where the resulting trajectory
data should be stored.

- n_points
an integer or vector of integers specifying the number of
points used to represent the spatially rescaled trajectories. If a single
integer is provided, the number of points will be constant across
trajectories. Alternatively, a vector of integers can provided that specify
the number of points for each trajectory individually.

## Value

A mousetrap data object (see mt_example) with an additional
array (by default called `ln_trajectories`

) containing the length
normalized trajectories. If a trajectory array was provided directly as
`data`

, only the length normalized trajectories will be returned.

## Details

`mt_length_normalize`

is used to emphasize the trajectories' shape.
Usually, the vast majority of points of a raw or a time-normalized trajectory
lie close to the start and end point. `mt_length_normalize`

re-distributes these points so that the spatial distribution is uniform
across the entire trajectory. `mt_length_normalize`

is mainly used to
improve the results of clustering (in particular mt_cluster) and
visualization.

## Author

Dirk U. Wulff

Jonas M. B. Haslbeck

Pascal J. Kieslich

## Examples

```
KH2017 <- mt_length_normalize(data=KH2017,
dimensions = c('xpos','ypos'),
n_points = 20)
```