src/taesooLib/PhysicsLib/convexhull/graham.cpp
double GrahamScan::direction( std::pair<double,double> p0,
                          std::pair<double,double> p1,
                          std::pair<double,double> p2 )
    {
        return ( (p0.first - p1.first ) * (p2.second - p1.second ) )
               - ( (p2.first - p1.first ) * (p0.second - p1.second ) );
    }
//
// In this program we frequently want to look at three consecutive
// points, p0, p1, and p2, and determine whether p2 has taken a turn
// to the left or a turn to the right.
//
// We can do this by by translating the points so that p1 is at the origin,
// then taking the cross product of p0 and p2. The result will be positive,
// negative, or 0, meaning respectively that p2 has turned right, left, or
// is on a straight line.
//
In this program we frequently want to look at three consecutive
points, p0, p1, and p2, and determine whether p2 has taken a turn
to the left or a turn to the right.

We can do this by by translating the points so that p1 is at the origin,
then taking the cross product of p0 and p2. The result will be positive,
negative, or 0, meaning respectively that p2 has turned right, left, or
is on a straight line.
In this program we frequently want to look at three consecutive points p0 p1 and p2 and determine whether p2 has taken a turn to the left or a turn to the right . We can do this by by translating the points so that p1 is at the origin then taking the cross product of p0 and p2 . The result will be positive negative or 0 meaning respectively that p2 has turned right left or is on a straight line .
double GrahamScan::direction( std::pair<double,double> p0,
                          std::pair<double,double> p1,
                          std::pair<double,double> p2 )
    {
        return ( (p0.first - p1.first ) * (p2.second - p1.second ) )
               - ( (p2.first - p1.first ) * (p0.second - p1.second ) );
    }
double GrahamScan :: direction ( std :: pair < double , double > p0 , std :: pair < double , double > p1 , std :: pair < double , double > p2 ) { return ( ( p0 . first - p1 . first ) * ( p2 . second - p1 . second ) ) - ( ( p2 . first - p1 . first ) * ( p0 . second - p1 . second ) ) ; }
In this program we frequently want to look at three consecutive
points, p0, p1, and p2, and determine whether p2 has taken a turn
to the left or a turn to the right.
In this program we frequently want to look at three consecutive points p0 p1 and p2 and determine whether p2 has taken a turn to the left or a turn to the right .