📜  Python – Sympy Triangle.is_isosceles() 方法

📅  最后修改于: 2022-05-13 01:55:41.637000             🧑  作者: Mango

Python – Sympy Triangle.is_isosceles() 方法

在 Sympy 中,函数Triangle.is_isosceles() 用于检查给定三角形是否为等腰三角形。等腰三角形是两条或多条边长度相同的三角形。
Syntax: Triangle.is_isosceles()

Returns: 
 True: if it is isosceles, otherwise False

示例 #1:

# import Triangle, Point
from sympy.geometry import Triangle, Point
  
# using Triangle()
t1 = Triangle(Point(0, 0), Point(6, 0), Point(3, 4))
  
# using is_isosceles()
isIsosceles = t1.is_isosceles()
print(isIsosceles)

输出:

True

示例 #2:

# import Triangle, Point
from sympy.geometry import Triangle, Point
  
# using Triangle()
t2 = Triangle(Point(0, 0), Point(3, 0), Point(3, 4))
  
# using is_isosceles()
isIsosceles = t2.is_isosceles()
print(isIsosceles)

输出:

False