Example #1
0
int Angle::compare(const Angle& that) const {
    const int q = quadrant();
    const int tq = that.quadrant();
    if( q > tq ) return 1;
    if( tq > q ) return -1;
    if( y && !x ) {
        if( that.y && !that.x ) {
            return 0;
        }
        return -1;
    }
    if( that.y && !that.x ) {
        return 1;
    }
    return y * that.x - x * that.y;
}