Open In App

SymPy | Polyhedron.vertices() in Python

Last Updated : 27 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
Polyhedron.vertices() : vertices() is a sympy Python library function that returns the vertices of the polyhedra.
Syntax : sympy.combinatorics.Polyhedrons.Polyhedron.vertices() Return : vertices of the Polyhedron.
Code #1 : vertices() Example - tetrahedron Python3 1=1
# Python code explaining
# SymPy.Polyhedron.vertices()

# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.polyhedron import tetrahedron, octahedron

# Using from 
# sympy.combinatorics.polyhedron.Polyhedron.vertices()

# Creating Polyhedron
a = tetrahedron.copy()

print ("Polyhedron - vertices form : ", a.vertices)

a.rotate(0)
print ("\nPolyhedron - vertices form : ", a.vertices)
Output :
Polyhedron - vertices form : (0, 1, 2, 3) Polyhedron - vertices form : (0, 2, 3, 1)
Code #2 : vertices() Example - octahedron Python3 1=1
# Python code explaining
# SymPy.Polyhedron.vertices()

# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.polyhedron import tetrahedron, octahedron

# Using from 
# sympy.combinatorics.polyhedron.Polyhedron.vertices()

# Creating Polyhedron
a = octahedron.copy()

print ("Polyhedron - vertices form : ", a.vertices)

a.rotate(0)
print ("\nPolyhedron - vertices form : ", a.vertices)
Output :
Polyhedron - vertices form : (0, 1, 2, 3, 4, 5) Polyhedron - vertices form : (0, 2, 3, 4, 1, 5)

Next Article
Article Tags :
Practice Tags :

Similar Reads