# DiscretePath

class DiscretePath[V, F](val points: Vector[V])(using nvs: NormedVectorSpace[V, F], order: Order[F])

Class of discrete path on a normed vector space V which consists of points in V of positive number. These objects, unlike continuous (with respect to the metric induced by norm on V) paths represented by `[0, 1]` -> V, has lost information on how fast these points should be traversed.

V must be a normed vector space over an ordered field F, which should be a subfield of the set of real numbers. It is required that the field operations are compatible with order relations. For more details, see https://en.wikipedia.org/w/index.php?title=Ordered_field&oldid=1049796158#Definitions.

Value Params
points

a nonempty sequence of points of V

Companion
object
class Object
trait Matchable
class Any

## Value members

### Concrete methods

def concat(another: DiscretePath[V, F]): DiscretePath[V, F]

Concatenate another path. The last point of this path will be connected to the initial point of another.

Concatenate another path. The last point of this path will be connected to the initial point of another.

def concatRebase(another: DiscretePath[V, F]): DiscretePath[V, F]

Concatenate another path in such a way that the last point of this path coincides the first point of another by translating another.

Concatenate another path in such a way that the last point of this path coincides the first point of another by translating another.

Return the reversed path, which contains elements of points in the reverse order.

Return the reversed path, which contains elements of points in the reverse order.

def mapLinear[W : ([W] =>> NormedVectorSpace[W, F])](f: V => W): DiscretePath[W, F]

Translate this path using a linear transformation f.

Translate this path using a linear transformation f.

def pointAt(distance: F): V

Compute the point in the path at which the total distance covered equals distance.

Compute the point in the path at which the total distance covered equals distance.

def rebaseAt(v: V): DiscretePath[V, F]

Translate this path so that the initial data point is at the specified vector.

Translate this path so that the initial data point is at the specified vector.

Translate this path so that the initial data point is at zero.

Translate this path so that the initial data point is at zero.

def tangentAt(distance: F): Option[V]

Compute a vector parallel to a tangent of the path passing `pointAt(distance)`.

Compute a vector parallel to a tangent of the path passing `pointAt(distance)`.

This function returns a None when the path is empty. Otherwise, if we let `p` denote `pointAt(distance)`, this function returns a vector by the following rules:

• if `distance` is zero and `p` equals the starting point of the path, the returned vector is parallel to the line segment outgoing from `p`
• if `distance` equals `totalDistance` and `p` equals the last point of the path, the returned vector is parallel to the line segment incoming into `p`
• if `p` is at some sampling point of the curve, let `v1` and `v2` be unit vectors parallel to the line segments incoming into (resp. outgoing from) `p`, and:
• if `v1` is the opposite of `v2` (equals `v2.negate`) then the returned vector is parallel to `v1`
• otherwise the returned vector is parallel to `v1` + `v2`.
def translate(v: V): DiscretePath[V, F]

Translate the entire path with vector2D.

Translate the entire path with vector2D.

### Concrete fields

lazy
val cumulativeDistance: Vector[F]

The partial sum of arc length of this discrete path. `n` th element of this Vector contains a total distance travelled from the first point upto `n` th element in points.

The partial sum of arc length of this discrete path. `n` th element of this Vector contains a total distance travelled from the first point upto `n` th element in points.

This sequence is increasing, because the field is ordered and norm returns non-negative field elements.

val points: Vector[V]
lazy

Total length of this path.

Total length of this path.