Sunday, October 5, 2025
HomeLanguagesPython | sympy Triangle() method

Python | sympy Triangle() method

The function Triangle() takes the given points as vertices of a triangle and computes the area of triangle with the help of area.

Syntax: Triangle(x, y, z).area

Parameters: where x, y, z are coordinates.

Return: Area of triangle.

Example #1:

Python3




# import sympy and geometry module
from sympy import * 
from sympy.geometry import * 
  
x = Point(0, 0)
y = Point(1, 1)
z = Point(1, 0)
  
# Using  Triangle(x, y, z).area
giveArea = Triangle(x, y, z).area
  
print(giveArea)


Output:

1/2

Example #2:

Python3




# import sympy and geometry module
from sympy import * 
from sympy.geometry import * 
  
x = Point(1, 2)
y = Point(2, 0)
z = Point(1, 0)
  
# Using  Triangle(x, y, z).area
giveArea = Triangle(x, y, z).area
  
print(giveArea)


Output:

1
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32337 POSTS0 COMMENTS
Milvus
86 POSTS0 COMMENTS
Nango Kala
6706 POSTS0 COMMENTS
Nicole Veronica
11871 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11936 POSTS0 COMMENTS
Shaida Kate Naidoo
6823 POSTS0 COMMENTS
Ted Musemwa
7089 POSTS0 COMMENTS
Thapelo Manthata
6779 POSTS0 COMMENTS
Umr Jansen
6779 POSTS0 COMMENTS