@saehrimnir/druidjs / norm
Function: norm()
ts
function norm(v:
| number[]
| Float64Array<ArrayBufferLike>
| Matrix, metric?: Metric): number;Defined in: matrix/norm.js:14
Computes the norm of a vector, by computing its distance to 0.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
v | | number[] | Float64Array<ArrayBufferLike> | Matrix | undefined | Vector. |
metric? | Metric | euclidean | Which metric should be used to compute the norm. Default is euclidean |
Returns
number
- The norm of
v.