Computing the geographic angle

Hello,
Happy new year ! And thanks a lot for this wonderfull software library.

Could you share the calculation of the geographic angle implemented in this function Utils.GetAngle ?
I suppose I can found the code associated with this function in the sources. However, I need only the detail of this formula in MapWinGis.

Hello @Gilles

I’m glad here you are getting good use of the library. Here’s the function:

STDMETHODIMP CUtils::GetAngle(IPoint* firstPoint, IPoint* secondPoint, double* retVal)
{
    double x1, y1, x2, y2, dx, dy;
    // get delta X and Y
    firstPoint->get_X(&x1);
    firstPoint->get_Y(&y1);
    secondPoint->get_X(&x2);
    secondPoint->get_Y(&y2);
    dx = x2 - x1;
    dy = y2 - y1;
    // return angle in degrees
    *retVal = GeometryHelper::GetPointAngleDeg(dx, dy);
    //
    return S_OK;
}

And the GetPointAngleDeg function:

double GeometryHelper::GetPointAngleDeg(double x, double y)
{
    return GetPointAngle(x, y) * 180.0 / pi_;
}

Regards,
Jerry.