Common Library
0.9.5
|
座標計算関数用名前空間 [詳解]
データ構造 | |
struct | Coord |
座標定義用構造体(2D用) [詳解] | |
struct | Less |
座標どうしの大小比較 ( Less ) 用関数オブジェクト [詳解] | |
関数 | |
template<class U , class T > | |
Coord< U > | Convert (const Coord< T > &c) |
異なる型の座標へ変換する [詳解] | |
template<class T > | |
T | AbsDiff (const T &t1, const T &t2) |
二数の差の絶対値を返す [詳解] | |
template<class D , class T > | |
D | Distance (Coord< T > c1, Coord< T > c2) |
距離(ノルム)の計算 [詳解] | |
template<class T > | |
void | Diff (Coord< T > c1, Coord< T > c2, Coord< T > *diff) |
二座標間の差分(絶対値)を求める [詳解] | |
template<class T > | |
void | Sign (Coord< T > s, Coord< T > e, Coord< int > *sign) |
二座標 s, e 間の直線の向きを求める [詳解] | |
template<class D , class T > | |
D | Gradient (Coord< T > c0, Coord< T > c1, bool rotate=false) |
傾きを返す [詳解] | |
template<class D , class T > | |
D | Intercept (Coord< T > c0, Coord< T > c1, bool rotate=false, T axis=0) |
切片を返す [詳解] | |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const Coord< T > &c) |
ストリーム出力 [詳解] | |
座標計算関数用名前空間
異なる型の座標へ変換する
c | コピー元の座標 |
T TF_CoordLib::AbsDiff | ( | const T & | t1, |
const T & | t2 | ||
) |
二数の差の絶対値を返す
t1,t2 | ニ数 |
距離(ノルム)の計算
c1,c2 | 演算対象の座標 |
二座標間の差分(絶対値)を求める
x, y それぞれに対して差の絶対値を求め、変数 diff に代入する
c1,c2 | 差分を計算する二点 |
diff | 求めた差分を代入する変数へのポインタ |
二座標 s, e 間の直線の向きを求める
x, y それぞれ e >= s ならば 1 e < s ならば -1 とする
s | 始点 |
e | 終点 |
sign | 求めた直線の向きを代入する変数へのポインタ |
D TF_CoordLib::Gradient | ( | Coord< T > | c0, |
Coord< T > | c1, | ||
bool | rotate = false |
||
) |
傾きを返す
c0,c1 | 直線を通る二点 |
rotate | falseで dy/dx, trueで dx/dyを返す |
D TF_CoordLib::Intercept | ( | Coord< T > | c0, |
Coord< T > | c1, | ||
bool | rotate = false , |
||
T | axis = 0 |
||
) |
切片を返す
c0,c1 | 直線を通る二点 |
rotate | false で y 軸, true で x 軸との交点を返す |
axis | : 軸の位置 ( x 軸または y 軸がもう一方の軸と交差する位置 ) |
std::ostream& TF_CoordLib::operator<< | ( | std::ostream & | os, |
const Coord< T > & | c | ||
) |
ストリーム出力
os | 対象の出力ストリームへの参照 |
c | 出力対象の座標への参照 |