Beispiel #1
0
 def is_right(self):
     """Returns True if the triangle is right-angled, False otherwise."""
     s = self.sides
     return (
         Segment.is_perpendicular(s[0], s[1])
         or Segment.is_perpendicular(s[1], s[2])
         or Segment.is_perpendicular(s[0], s[2])
     )
Beispiel #2
0
    def is_right(self):
        """Is the triangle right-angled.

        Returns
        -------
        is_right : boolean

        Examples
        --------
        >>> from sympy.geometry import Triangle, Point
        >>> t1 = Triangle(Point(0, 0), Point(4, 0), Point(4, 3))
        >>> t1.is_right()
        True

        """
        s = self.sides
        return Segment.is_perpendicular(s[0], s[1]) or \
               Segment.is_perpendicular(s[1], s[2]) or \
               Segment.is_perpendicular(s[0], s[2])
Beispiel #3
0
    def is_right(self):
        """Is the triangle right-angled.

        Returns
        -------
        is_right : boolean

        Examples
        --------
        >>> from sympy.geometry import Triangle, Point
        >>> t1 = Triangle(Point(0, 0), Point(4, 0), Point(4, 3))
        >>> t1.is_right()
        True

        """
        s = self.sides
        return Segment.is_perpendicular(s[0], s[1]) or \
               Segment.is_perpendicular(s[1], s[2]) or \
               Segment.is_perpendicular(s[0], s[2])
Beispiel #4
0
 def is_right(self):
     """Returns True if the triangle is right-angled, False otherwise."""
     s = self.sides
     return Segment.is_perpendicular(s[0], s[1]) or \
            Segment.is_perpendicular(s[1], s[2]) or \
            Segment.is_perpendicular(s[0], s[2])