名前
hypot, hypotf, hypotl - ユークリッド距離関数
書式
#include <math.h>
double hypot(double x, double y);
float hypotf(float x, float y);
long double hypotl(long double x, long double y);
-lm でリンクする。
説明
hypot() 関数は sqrt(x*x+y*y) の値を返す。 これは 直角を挟む 2 辺の長さが x と y である直角三角形の斜辺の長さ、 すなわち、原点と点 (x,y) との距離である。
準拠
SVr4, 4.3BSD, C99. float 版と long double 版は C99 の要求仕様である。