Exemple #1
0
 public double Perimeter(CoordinatesHelper point1, CoordinatesHelper point2, CoordinatesHelper point3)
 {
     //Returns the perimeter of the triangle drawn by point1, point2 and point3
     return(Distance(point1, point2) + Distance(point2, point3) + Distance(point3, point1));
 }
Exemple #2
0
 public double StraightLineSlope(CoordinatesHelper point1, CoordinatesHelper point2)
 {
     //Returns the slope of the straight line drawn by point1 and point2
     return((point2.PositionY - point1.PositionY) / (point2.PositionX - point1.PositionX));
 }
Exemple #3
0
 public bool PositiveOrientation(CoordinatesHelper point1, CoordinatesHelper point2, CoordinatesHelper point3)
 {
     //Returns the orientation of the triangle drawn by point1, point2 and point3
     return(((point1.PositionX - point3.PositionX) * (point2.PositionY - point3.PositionY)) -
            ((point1.PositionY - point3.PositionY) * (point2.PositionX - point3.PositionX)) >= 0);
 }
Exemple #4
0
 public double Distance(CoordinatesHelper point1, CoordinatesHelper point2)
 {
     //Returns the distance between point1 and point2
     return(Math.Sqrt(Math.Pow(point1.PositionX - point2.PositionX, 2) +
                      Math.Pow(point1.PositionY - point2.PositionY, 2)));
 }
Exemple #5
0
 public double StraightLineSlope(CoordinatesHelper point1, CoordinatesHelper point2, int nFractionalDigits)
 {
     //Returns the slope of the straight line drawn by point1 and point2 rounded to n fractional digits
     return(Math.Round(StraightLineSlope(point1, point2), nFractionalDigits));
 }