Is a line formed by two points greater than 90 degrees off of the horzontal.
- by Scott Chamberlain
I am trying to find out if a line defined by two points is greater than or equal to 90 degrees compared to the horizontal. Here is the code I used
bool moreThan90 = false;
double angle = Math.Atan((double)(EndingLocation.Y - Location.Y) / (double)(EndingLocation.X - Location.X));
if (angle >= Math.PI / 2.0 || angle <= -Math.PI / 2.0)
moreThan90 = true;
Did I do this correctly or is there a better built in function in .Net that will find this?