I have seen a code, but I don't know how to set the IPoint2D Start and IPoint2D End which are the GetAngle method's parameters?
public interface IPoint2D
{
int mX { get; set; }
int mY { get; set; }
void Set(int X, int Y);
string ToString();
}
public static class GeometryAlgorithm
{
public static double GetAngle(IPoint2D Start, IPoint2D End)
{
return Math.Atan((End.mY - Start.mY)/(End.mX - Start.mX)) / Math.PI * 180.0f;
}
}
First, you should define a class implementing this interface. Here is demo code
Now you can create instances of this class and pass it to
GetAnglemethod.