Clase de Programacion para fisica medica

import matplotlib.pyplot as plt

import numpy as np

def ejes():
    max=1
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
ejes()
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)
x = np.array([0,10,5,0])
y = np.array([0,0,8.66,0])
plt.plot(x,y,'-or')


plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)

x1 = np.array([0,10,5,0])
y1 = np.array([0,0,8.66,0])
plt.plot(x1,y1,'-or')

x2 = np.array([0,-10,-5,0])
y2 = np.array([0,0,8.66,0])
plt.plot(x2,y2,'-or')


plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)

x1 = np.array([0,10,5,0])
y1 = np.array([0,0,8.66,0])
plt.plot(x1,y1,'-or')

x2 = np.array([0,-10,-5,0])
y2 = np.array([0,0,8.66,0])
plt.plot(x2,y2,'-or')

x3 = np.array([0,-10,-5,0])
y3 = np.array([0,0,-8.66,0])
plt.plot(x3,y3,'-or')


plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)

x1 = np.array([0,10,5,0])
y1 = np.array([0,0,8.66,0])
plt.plot(x1,y1,'-or')

x2 = np.array([0,-10,-5,0])
y2 = np.array([0,0,8.66,0])
plt.plot(x2,y2,'-or')

x3 = np.array([0,-10,-5,0])
y3 = np.array([0,0,-8.66,0])
plt.plot(x3,y3,'-or')

x4 = np.array([0,10,5,0])
y4 = np.array([0,0,-8.66,0])
plt.plot(x4,y4,'-or')


plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)

x1 = np.array([0,10,5,0])
y1 = np.array([0,0,8.66,0])
plt.plot(x1,y1,'-or')

x2 = np.array([0,-10,-5,0])
y2 = np.array([0,0,8.66,0])
plt.plot(x2,y2,'-or')

x3 = np.array([0,-10,-5,0])
y3 = np.array([0,0,-8.66,0])
plt.plot(x3,y3,'-or')

x4 = np.array([0,10,5,0])
y4 = np.array([0,0,-8.66,0])
plt.plot(x4,y4,'-or')


x5=np.array([-10,-5 ,5  ,10,   5,  -5,-10])
y5=np.array([  0,8.6,8.6, 0,-8.6,-8.6,0])
plt.plot(x5,y5,'-ob')

plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)




x5=np.array([-10,-5 ,5  ,10,   5,  -5,-10])
y5=np.array([  0,8.6,8.6, 0,-8.6,-8.6,0])
plt.plot(x5,y5,'-ob')

plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)

x1 = np.array([0])
y1 = np.array([0])
plt.plot(x1,y1,'ob')


x5=np.array([-10,-5 ,5  ,10,   5,  -5,-10])
y5=np.array([  0,8.6,8.6, 0,-8.6,-8.6,0])
plt.plot(x5,y5,'-ob')

plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()
import matplotlib.pyplot as plt

import numpy as np

def ejes(max):
    hx=np.array([-max,max])
    hy=np.array([0,0])
    plt.plot(hx,hy,'-k',linewidth=2)
    
    vx=np.array([0,0])
    vy=np.array([-max,max])
    plt.plot(vx,vy,'-k',linewidth=2)
    
    
ejes(20)


cx = 0.0
cy = 0.0
x1 = np.array([cx])
y1 = np.array([cy])
plt.plot(x1,y1,'ob')


x5=np.array([cx-10,cx-5  ,cx+5  ,cx+10,cx+5  ,cx-5  ,cx-10])
y5=np.array([cy+0 ,cy+8.6,cy+8.6,cy+0 ,cy-8.6,cy-8.6,cy+0])
plt.plot(x5,y5,'-ob')

plt.title('Como hago un hexagono?')

plt.grid()
plt.axis('square')
plt.show()