segmentsGap関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How close two leaders come, where they do not cross: the nearest any point of one gets to the other. Zero when they cross.
インポート
import { segmentsGap } from "@johnmorrisdotca/chizu";
定義
function segmentsGap(a: readonly [number, number], b: readonly [number, number], c: readonly [number, number], d: readonly [number, number]): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
a | readonly [number, number] | The first point or segment endpoint, in native map units. |
b | readonly [number, number] | The second point or segment endpoint, in native map units. |
c | readonly [number, number] | The first endpoint of the other segment, in native map units. |
d | readonly [number, number] | The second endpoint of the other segment, in native map units. |
戻り値
number
How close two leaders come, where they do not cross: the nearest any point of one gets to the other. Zero when they cross.
例
import { segmentsGap } from "@johnmorrisdotca/chizu";
console.log(segmentsGap([0, 0], [10, 0], [0, 5], [10, 5]));
// 55出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。