Reference · Deterministic 2D physics
lengthfunction
The length of (x, y).
Import it
import { length } from "@johnmorrisdotca/karakuri/physics";
Definition
function length(x: number, y: number): number
Parameters
| Name | Type | Description |
|---|---|---|
x | number | The horizontal coordinate or vector component in native units. |
y | number | The vertical coordinate or vector component in native units. |
Returns
number
The length of (x, y).
Examples
import { length } from "@johnmorrisdotca/karakuri/physics";
console.log(length(3,4));5What it prints (run when this page was built)