distance関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The distance between two points.
インポート
import { distance } from "@johnmorrisdotca/karakuri/physics";
定義
function distance(ax: number, ay: number, bx: number, by: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
ax | number | The first segment endpoint’s horizontal coordinate. |
ay | number | The first segment endpoint’s vertical coordinate. |
bx | number | The second segment endpoint’s horizontal coordinate. |
by | number | The second segment endpoint’s vertical coordinate. |
戻り値
number
The distance between two points.
例
import { distance } from "@johnmorrisdotca/karakuri/physics";
console.log(distance(0,0,3,4));5出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。