日本語 English
株式会社ヒューリンクス
TEL:03-5642-8384
営業時間:9:00-17:30

dist

関数 dist は、直線の長さをスカラーで返します。直線は XY のペアで定義される線分であらわされるもので、引数 x range y range で指定します。

構文

dist(x range, y range)

引数 x rangex 座標、引数 y rangey 座標の値を指定します。2つの範囲の対応する値同士が、X,Y のペアとなります。2つの範囲の大きさが等しくない場合は、余分な X または Y は無視されます。

  • 範囲 x ={0,1,1,0,0}y = {0,0,1,1,0} の場合、dist(x,y) は、4.0 を返します。指定した XY の座標は、単位 1 の x と単位 1 の y からなる正方形を表します。

関連情報

dist

The dist function returns a scalar representing the distance along a line. The line is described in segments defined by the X,Y pairs specified in an x range and a y range.

Syntax

dist(x range,y range)

The x range argument contains the X coordinates, and the y range argument contains the Y coordinates. Corresponding values in these ranges form X,Y pairs. If the ranges are uneven in size, excess X or Y points are ignored.

Example

For the ranges x ={0,1,1,0,0} and y = {0,0,1,1,0}, the operation dist(x,y) returns 4.0. The X and Y coordinates provided describe a square of 1 unit x by 1 unit y.

関連情報