To the Line class add an instance method with the signature
public double getSlope() which returns the slope of a line.
Next, to the Line class add an instance method with the following signature public
boolean isPerpendicularTo(Line anotherLine) which returns true if a
given line is perpendicular to anotherLine passed as a parameter, false
otherwise. Recall that two lines are perpendicular to each other if the slope of
one line is the negative reciprocal of the slope of the other. Test this method
by instantiating two Line objects and testing if they are perpendicular to each
other. Are there any special conditions that you have to guard against ?
Next, to the Triangle class add a method public boolean isRightTriangle() which returns true if the triangle has a right angle (90 degrees) i.e. two sides are perpendicular to each other, false otherwise.
The next step assumes that your Line class contains a method named public double length() which returns the length of a given line, that you wrote in an earlier lab. To the Triangle class add a method public boolean isIsosceles() which returns true if the triangle is an isosceles triangle, false otherwise. Recall that a triangle is isosceles if ....
Next, to the triangle class add a method public boolean isRightIsosceles() which returns true if the triangle is both isosceles and a right triangle, false otherwise.
Finally, to the Quadrangle class add a method public boolean isSquare() which returns true if the quadrangle is a square, false otherwise.