# Include < Iostream >
# Include < Cmath >
Using Namespace STD;
Const Double Epoints = 1e - 9 ;
Int SGN ( Double A ){
Return ( > Epoints) - ( < - Epoints );
}
Const Double Pointi = ACOs ( - 1.0 );
Struct Point {
Double X, Y;
Point ( Double Xx = 0 , Double YY = 0 ){
X = XX; y = YY;
}
Bool Operator = ( Const Point & A) Const {
Return SGN (x - A. X) = 0 && SGN (Y - A. Y) = 0 ;
}
Bool Operator ! = ( Const Point & A) Const {
Return SGN (x - A. X) ! = 0 | SGN (Y - A. Y) ! = 0 ;
}
Bool Operator < ( Const Point & A) Const {
Return SGN (Y - A. Y) < 0 | SGN (Y - A. Y) = 0 && SGN (x - A. X) < 0 ;
}
Point Operator + ( Const Point & A) Const {
Return Point (x + A. X, Y + A. Y );
}
Point Operator - ( Const Point & A) Const {
Return Point (x - A. X, Y - A. Y );
}
Point Operator ^ ( Const Double & A) Const {
Return Point (x * A, y * A );
}
Double Operator ^ ( Const Point & A) Const { // Point product
Return X * A. x + Y * A. Y;
}
Double Operator * ( Const Point & A) Const { // Cross Product
Return X * A. Y - Y * A. X;
}
Point trunlen ( Double A) Const {
A /= SQRT (x * X + Y * Y );
Return Point (x * A, y * A );
}
Point turn_left () Const {
Return Point ( - Y, X );
}
Point turn_right () Const {
Return Point (Y, - X );
}
Double Cross ( Const Point & A, Const Point & B) Const { // Use this as the starting point of the Two-vector Cross Product
Return (A. x - X) * (B. Y - Y) - (A. Y - Y) * (B. x - X );
}
Double DOT ( Const Point & A, Const Point & B) Const { // Starting from this, the dot product of two vectors
Return (A. x - X) * (B. x - X) + (A. Y - Y) * (B. Y - Y );
}
Double Len2 (){
Return X * X + Y * Y;
}
Double Len ()
{
Return SQRT (len2 ());
}
Void Input (){
Scanf ( " % Lf " , & X, & Y );
}
Void Output () Const {
Printf ( " % Lf \ n " , X, y );
}
};
Int Main ()
{
Return 0 ;
}
ReferenceACM Wuhan University wiki algorithm Introduction