示例#1
0
inline bool vec_normalize(Point & pt, typename coordinate_type<Point>::type & len)
{
    typedef typename coordinate_type<Point>::type coord_t;

    coord_t const c0 = 0;
    len = vec_length(pt);

    if (math::equals(len, c0))
    {
        return false;
    }

    divide_value(pt, len);
    return true;
}
示例#2
0
 static inline void result(sum const& state, PointCentroid& centroid)
 {
     centroid = state.centroid;
     divide_value(centroid, state.count);
 }