app/src/main/jni/ParalLine.cpp
double GetLineAngle ( DSCC_POINT Start, DSCC_POINT End )
{
    if ( End.x != Start.x )
    {
        double atg = atan ( ((double)(Start.y-End.y)) / ((double)(End.x-Start.x)) ) ;
        if ( End.x > Start.x )
            return atg ;
        else
        {
            if ( End.y < Start.y )
                return atg+PI ;
            else
                return atg-PI ;
        }
    }
    else
    {
        if ( End.y < Start.y )
            return PI/2 ;
        else if ( End.y > Start.y )
            return -PI/2 ;
        else
            return 0 ;
    }
}
/*************************************************************************************
/*	Name:		GetLineAngle
/*	Function:	Calculate the angle of the line formed by two points
/*	Parameter:	Start -- Starting point
/*				End -- Ending point
/*	Return:		Angle of the line
/**************************************************************************************/
GetLineAngle
Function:       Calculate the angle of the line formed by two points
Parameter:      Start -- Starting point
End -- Ending point
Return:         Angle of the line
GetLineAngle Function : Calculate the angle of the line formed by two points Parameter : Start -- Starting point End -- Ending point Return : Angle of the line
double GetLineAngle ( DSCC_POINT Start, DSCC_POINT End )
{
    if ( End.x != Start.x )
    {
        double atg = atan ( ((double)(Start.y-End.y)) / ((double)(End.x-Start.x)) ) ;
        if ( End.x > Start.x )
            return atg ;
        else
        {
            if ( End.y < Start.y )
                return atg+PI ;
            else
                return atg-PI ;
        }
    }
    else
    {
        if ( End.y < Start.y )
            return PI/2 ;
        else if ( End.y > Start.y )
            return -PI/2 ;
        else
            return 0 ;
    }
}
double GetLineAngle ( DSCC_POINT Start , DSCC_POINT End ) { if ( End . x != Start . x ) { double atg = atan ( ( ( double ) ( Start . y - End . y ) ) / ( ( double ) ( End . x - Start . x ) ) ) ; if ( End . x > Start . x ) return atg ; else { if ( End . y < Start . y ) return atg + PI ; else return atg - PI ; } } else { if ( End . y < Start . y ) return PI / 2 ; else if ( End . y > Start . y ) return - PI / 2 ; else return 0 ; } }
Name:           GetLineAngle
Function:       Calculate the angle of the line formed by two points
Parameter:      Start -- Starting point
End -- Ending point
Return:         Angle of the line
Name : GetLineAngle Function : Calculate the angle of the line formed by two points Parameter : Start -- Starting point End -- Ending point Return : Angle of the line