SymPy | Poliedro.pgroup() en Python

Polyhedron.pgroup() : pgroup() es una función de biblioteca Sympy de Python que devuelve las permutaciones de los poliedros.

Sintaxis: sympy.combinatorics.Polyhedrons.Polyhedron.pgroup()

Retorno : permutaciones del Poliedro.

Código #1: pgroup() Ejemplo – tetraedro

# Python code explaining
# SymPy.Polyhedron.pgroup()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.polyhedron import tetrahedron, octahedron
  
# Using from 
# sympy.combinatorics.polyhedron.Polyhedron.pgroup()
  
# Creating Polyhedron
a = tetrahedron.copy()
  
print ("Polyhedron - pgroup form : ", a.pgroup)
  
a.rotate(0)
print ("\nPolyhedron - pgroup form : ", a.pgroup)

Producción :

Poliedro – forma pgroup: PermutationGroup([
(1 2 3),
(3)(0 1 2),
(0 3 2),
(0 3 1),
(0 1)(2 3),
(0 2)(1) 3),
(0 3)(1 2)])

Poliedro – forma pgroup: PermutationGroup([
(1 2 3),
(3)(0 1 2),
(0 3 2),
(0 3 1),
(0 1)(2 3),
(0 2)(1) 3),
(0 3)(1 2)])

Código #2: pgroup() Ejemplo – octaedro

# Python code explaining
# SymPy.Polyhedron.pgroup()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.polyhedron import tetrahedron, octahedron
  
# Using from 
# sympy.combinatorics.polyhedron.Polyhedron.pgroup()
  
# Creating Polyhedron
a = octahedron.copy()
  
print ("Polyhedron - pgroup form : ", a.pgroup)
  
a.rotate(0)
print ("\nPolyhedron - pgroup form : ", a.pgroup)

Producción :

Poliedro – forma pgroup: PermutationGroup([
(5)(1 2 3 4),
(0 4 5 2),
(0 1 5 3),
(0 1)(2 4)(3 5),
(0 2)( 1 3)(4 5),
(0 3)(1 5)(2 4),
(0 4)(1 3)(2 5),
(0 5)(1 4)(2 3),
(0 5 )(1 2)(3 4),
(0 4 1)(2 3 5),
(0 1 2)(3 4 5),
(0 2 3)(1 5 4),
(0 4 3)(1 5 2)])

Poliedro – forma pgroup: PermutationGroup([
(5)(1 2 3 4),
(0 4 5 2),
(0 1 5 3),
(0 1)(2 4)(3 5),
(0 2)( 1 3)(4 5),
(0 3)(1 5)(2 4),
(0 4)(1 3)(2 5),
(0 5)(1 4)(2 3),
(0 5 )(1 2)(3 4),
(0 4 1)(2 3 5),
(0 1 2)(3 4 5),
(0 2 3)(1 5 4),
(0 4 3)(1 5 2)])

Publicación traducida automáticamente

Artículo escrito por noobestars101 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *