miércoles, 14 de febrero de 2024

Mostrar Ventana con un Boton y Pasar Datos entre Formularios con Visual Basic 2022

 

Form1.vb
Public Class Form1
        Private Sub btnOpen_Click(sender As Object, e As EventArgs) Handles btnOpen.Click
            Form2.Show()
        End Sub
End Class
-----------------------------------------------
Form2.vb
Public Class Form2
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label2.Text = Form1.TextBox1.Text
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Form1.Label1.Text = TextBox1.Text
End Sub
End Class
minuvasoft10@gmail.com - Se Realizan Programas con Visual Basic 2022 


martes, 13 de febrero de 2024

Graficar Funcion Cubica con Matplotlib y Python

 

import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(-2,2,1000)
y2 = 2*t**3 + 3*t**2 - t - 2
plt.axhline(0, color='black')
plt.axvline(0, color='black')
plt.xlabel('t')
plt.ylabel('y')
plt.plot(t,y2,'o:b')
plt.grid(True)
plt.show()


martes, 6 de febrero de 2024

Graficar Parabola con Python y Matplotlib

 

import matplotlib.pyplot as plt
import numpy as np
v = 0
g = 9.81
t = np.linspace(-1,1,1000)
#y = v*t - 0.5*g*t**2
y2 = v*t + 0.5*g*t**2
plt.xlabel('t')
plt.ylabel('y')
#plt.plot(t,y,'o:b')
plt.plot(t,y2,'o:b')
plt.show()
minuvasoft10@gmail.com Se realizan programas en Java, Python, Mysql.


martes, 30 de enero de 2024

Graficar Rosa con Coordenadas Polares con Python y Matplotlib

 

import numpy as np
import matplotlib.pyplot as plt
a = []
i = 0
alfa = 0.01
r3 = []
for i in range(0,770):
     alfa = 0.04*i
     alfa = round(alfa,2)
     a.append(alfa)
     r4 = 3*np.sin(np.pi*alfa) # cambiar np.pi por 3 para obtener 
       # una rosa de 3 petalos, por 4 para 4 petalos.
     r3.append(r4)
print(a)
ax = plt.subplot(111, projection='polar')
ax.plot(a, r3)
ax.set_rmax(3.5)
ax.set_rticks([0.5, 1, 1.5, 2, 2.5, 3, 3.5])  # less radial ticks
ax.set_rlabel_position(-22.5)  # get radial labels away from plotted line
ax.grid(True)

ax.set_title("A line plot on a polar axis", va='bottom')
plt.show()
# con np.pi se obtiene la grafica de abajo.

minuvasoft10@gmail.com Programador de Proyectos Software
download here






jueves, 25 de enero de 2024

Graficar la funcion seno en 3d con Python y Matplotlib

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
x = np.linspace(-6,6,30)
y = np.linspace(-6,6,30)
X,Y = np.meshgrid(x,y)
Z = np.sin(X)

fig = plt.figure()
ax = plt.axes(projection='3d')

ax.contour3D(X,Y,Z,50,cmap='binary')
plt.show()


lunes, 22 de enero de 2024

Graficar Resorte con Python y Matplotlib

Tener instalado la libreria matplotlib. Desde la linea de comandos o CMD digitar pip install matplotlib.

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
X = np.linspace(0,15,1000)
Y = np.cos(X)

Z = np.sin(X)

fig = plt.figure()
ax = plt.axes(projection='3d')

ax.plot3D(X,Y,Z)
plt.show()


domingo, 14 de enero de 2024

Graficar con Coordenadas Polares en Python y Matplotlib

import numpy as np
import matplotlib.pyplot as plt
a = []
i = 0
k = 0.01
for i in range(0,6):
     k = k + 3.14/4
     k = round(k,2)
     a.append(k)
r = np.arange(0, 2, 0.01)
r2 = [0.5,0.6,0.7,0.8,0.9,1]
theta = 2 * np.pi * r

ax = plt.subplot(111, projection='polar')
ax.plot(a, r2)
ax.set_rmax(2)
ax.set_rticks([0.5, 1, 1.5, 2])  # less radial ticks
ax.set_rlabel_position(-22.5)  # get radial labels away from plotted line
ax.grid(True)

ax.set_title("A line plot on a polar axis", va='bottom')
plt.show()

minuvasoft10@gmail.com 
download here



 

Conectar a MySql con Java Netbeans mediante un Formulario

 Tener agregado en libraries el conector mysql. clase coneBD.java package pktForm12; import java.sql.*; import javax.swing.JOptionPane; publ...