# Morphing

A *morphing* is an encoding of a "matching" between two curves. It is the output of the various Frechet distance computation functions. The package provides some basic geometric types in the cg submodule.

## Types

`FrechetDist.Morphing`

— Type`Morphing`

Encoding of a moprhing (i.e., matching) between two polygonal cuves.

## Functions

`FrechetDist.Morphing_monotonize`

— Function`Morphing_monotonize`

Turns a morphing into a monotone morphing, by simply not going back, staying in place if necessary.

`FrechetDist.Morphing_empty`

— Function`Morphing_empty`

Returns an empty morhping (i.e., a constructor).

`FrechetDist.Morphing_verify_valid`

— Function`Morphing_verify_valid`

Does some minimal checks that the morphing is valid. Speciifcally, check the times stemps of the events are valid.

`FrechetDist.Morphing_combine`

— Function`Morphing_combine`

Gets two morphings u, v (i.e., two parameterizations) and combine them into a single morphing u(v(.)).

For example, if u: γ → δ and v: δ → ξ, then the returned morphing is u(v(⋅)): γ → ξ.

`FrechetDist.Morphing_extract_prm`

— Function```
Morphing_extract_prm
A parameterization is a polygonal curve that starts at (0,0) and
end at (m,n). The polygonal curve either have positive slope edge,
or vertical or horizontal edges. It can be thought of as a
piecewise linear function from [0,m] to [0,n]. Here m and n are the
lengths of the two given polygons of P and Q, respectively.
```

`FrechetDist.Morphing_as_polygons`

— Function`Morphing_as_polygons`

Turns the morphing matching into a "true" matching, by creating two polygons that their edges are directly matched. The output polygons P and Q will definitely have reapeated points.

`FrechetDist.Morphing_extract_vertex_radii`

— Function```
Morphing_extract_vertex_radii
Computes for each polygon vertex, the length of the longest edge
in the matching attached ot it. It is a cheap upper bound on the
local Frechet distance for each vertex (and implicitly the
attached edge).
```

`FrechetDist.Morphing_extract_offsets`

— Function`Morphing_extract_offsets`

```