C++ (Qt)template <class T>struct vector2d{ vector2d(const T &_x = 1.0, const T &_y = 1.0) : x(_x), y(_y) {} T x; T y;}; template <class T>inline int sign(T x) { return (x >= 0) ? 1 : -1; } template <class T>inline bool is_contains(const vector2d<T> &v1, const vector2d<T> &v2, const vector2d<T> &v3) { int sign_v1_v2 = sign(v1.x*v2.y - v1.y*v2.x); int sign_v1_v3 = sign(v1.x*v3.y - v1.y*v3.x); int sign_v3_v2 = sign(v3.x*v2.y - v3.y*v2.x); return ((sign_v1_v2 == sign_v1_v3) && (sign_v1_v2 == sign_v3_v2));}