Figura 3D
import sys, math, pygame from operator import itemgetter class Point3D: def __init__ ( self , x= 0 , y= 0 , z= 0 ): self .x, self .y, self .z = float (x), float (y), float (z) def rotateX( self , angle): """ Rotates the point around the X axis by the given angle in degrees. """ rad = angle * math.pi / 180 cosa = math.cos(rad) sina = math.sin(rad) y = self .y * cosa - self .z * sina z = self .y * sina + self .z * cosa return Point3D( self .x, y, z) def rotateY( self , angle): """ Rotates the point around the Y axis by the given angle in degrees. """ rad = angle * math.pi / 180 cosa = math.cos(rad) sina = math.sin(rad) z = self .z * cosa - self .x * sina x = self .z * sina + self .x * cosa return Point3D(x, self .y, z) def rotateZ( self , angle): """ Rotates the point...