Skip to content
Related Articles

Related Articles

Python – Sympy Triangle.is_right() method
  • Last Updated : 26 May, 2020
In Sympy, the function Triangle.is_right() is used to check whether the given triangle is Right-Angled Triangle or not. Right-Angled Triangle is the triangle in which one angle is a right angle(90 degrees).
Syntax: Triangle.is_right()

Returns: 
 True: if it is right-angled, otherwise False

Example #1:




# import Triangle, Point
from sympy.geometry import Triangle, Point
    
# using Triangle()
t1 = Triangle(Point(0, 0), Point(4, 0), Point(4, 3))
    
# using is_right()
isRight = t1.is_right()
print(isRight)

Output:

True

 
Example #2:




# import Triangle, Point
from sympy.geometry import Triangle, Point
    
# using Triangle()
t2 = Triangle(Point(0, 0), Point(2, 0), Point(4, 3))
    
# using is_right()
isRight = t2.is_right()
print(isRight)

Output:

False

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :