# referencePathFrenet

## Description

The `referencePathFrenet`

object fits a smooth, piecewise,
continuous curve to a set of waypoints given as `[`

or *x*
*y*]`[`

. After fitting, points along the curve, the path points
are expressed as *x*
*y*
*theta*]`[`

, where:*x*
*y*
*theta*
*kappa*
*dkappa*
*s*]

*x**y*and*theta*— SE(2) state expressed in global coordinates, with*x*and*y*in meters and*theta*in radians*kappa*— Curvature, or inverse of the radius, in`m`

^{-1}*dkappa*— Derivative of curvature with respect to arc length in`m`

^{-2}*s*— Arc length, or distance along path from path origin, in meters

Using this object, convert trajectories between global and Frenet coordinate systems, interpolate states along the path based on arc length, and query the closest point on a path from a global state.

The object expresses Frenet states as a vector of form `[`

, where *S*
*dS*
*ddS*
*L*
*dL*
*ddL*]*S* is the arc length and
*L* is the perpendicular deviation from the direction of the reference
path. Derivatives of *S* are relative to time. Derivatives of
*L* are relative to the arc length, *S*.

## Creation

### Description

`refPathObj = referencePathFrenet(`

fits a piecewise, continuous set of curves to the specified waypoints. The
`waypoints`

)`waypoints`

argument sets the `Waypoints`

property.

`refPathObj = referencePathFrenet(___,`

sets properties using one or more name-value pair arguments in addition to the input
arguments in the previous syntax. You can specify the DiscretizationDistance and MaxNumWaypoints properties as name-value arguments.`Name,Value`

)

## Properties

## Object Functions

`closestPoint` | Find closest point on reference path to global point |

`closestPointsToSequence` | Projects sequence of points onto path |

`closestProjections` | Find orthogonal projections between path tangent vector and query point |

`curvature` | Return curvature at arclength |

`changeInCurvature` | Return change-in-curvature at arclength |

`frenet2global` | Convert Frenet states to global states |

`global2frenet` | Convert global states to Frenet states |

`interpolate` | Interpolate reference path at provided arc lengths |

`position` | Return xy-position at arclength |

`tangentAngle` | Return tangent angle at arclength |

`show` | Display reference path in figure |

## Examples

## Extended Capabilities

## Version History

**Introduced in R2020b**