0% found this document useful (0 votes)
21 views3 pages

Private Sub Cmdcalcular

The document contains code for a subroutine that takes input values from text boxes, performs calculations on them using determinants, and outputs the results to other text boxes. It first gets the input values, then calculates values for variables ds, dx, dy, and dz using determinants. It calculates x, y, and z by dividing dx, dy, and dz by ds, respectively. Finally, it outputs the values of x, y, and z to their corresponding text boxes.

Uploaded by

Brigith Liz Cll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

Private Sub Cmdcalcular

The document contains code for a subroutine that takes input values from text boxes, performs calculations on them using determinants, and outputs the results to other text boxes. It first gets the input values, then calculates values for variables ds, dx, dy, and dz using determinants. It calculates x, y, and z by dividing dx, dy, and dz by ds, respectively. Finally, it outputs the values of x, y, and z to their corresponding text boxes.

Uploaded by

Brigith Liz Cll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Private Sub cmdcalcular_Click()

Rem entrada de datos

a1 = Val(txta1.Text)

a2 = Val(txta2.Text)

a3 = Val(txta3.Text)

b1 = Val(txtb1.Text)

b2 = Val(txtb2.Text)

b3 = Val(txtb3.Text)

c1 = Val(txtc1.Text)

c2 = Val(txtc2.Text)

c3 = Val(txtc3.Text)

d1 = Val(txtd1.Text)

d2 = Val(txtd2.Text)

d3 = Val(txtd3.Text)

Rem procesando datos

ds = (a1 * b2 * c3 - a2 * b3 * c1 + a3 * b1 * c2) - (c1 * b2 * a3 + c2 * b3 * a1 - c3 * b1 * a2)

dx = (d1 * b2 * c3 + b1 * c2 * d3 - c1 * d2 * b3) - (c1 * b2 * d3 - d1 * c2 * b3 - b1 * d2 * c3)

dy = (a1 * d2 * c3 + a2 * d3 * c1 + a3 * d1 * c2) - (c1 * d2 * a3 - c2 * d3 * a1 - c3 * d1 * a2)

dz = (a1 * b2 * d3 - b1 * d2 * a3 + d1 * a2 * b3) - (d1 * b2 * a3 - a1 * b2 * b3 - b1 * a2 * d3)

x = dx / ds

y = dy / ds

Z = dz / ds

Rem de salida de datos

txtx.Text = x
txty.Text = y

txtz.Text = Z

End Sub

'entrada de datos

A1 = Val(txta1.Text)

A2 = Val(txta2.Text)

A3 = Val(txta3.Text)

B1 = Val(txtb1.Text)

B2 = Val(txtb2.Text)

B3 = Val(txtb3.Text)

C1 = Val(txtc1.Text)

C2 = Val(txtc2.Text)

C3 = Val(txtc3.Text)

D1 = Val(txtd1.Text)

D2 = Val(txtd2.Text)

D3 = Val(txtd3.Text)
'procesando de datos

DS = A1 * B2 * C3 + B1 * C2 * A3 + C1 * A2 * B3 - C1 * B2 * A3 - B1 * A2 * C3 - A1 * C2 * B3

DX = D1 * B2 * C3 + B1 * C2 * D3 + C1 * D2 * B3 - C1 * B2 * D3 - D1 * C2 * B3 - B1 * D2 * C3

DY = A1 * D2 * C3 + A2 * D3 * C1 + A3 * D1 * C2 - C1 * D2 * A3 - C2 * D3 * A1 - C3 * D1 * A2

DZ = A1 * B2 * D3 + B1 * D2 * A3 + D1 * A2 * B3 - D1 * B2 * A3 - A1 * D2 * B3 - B1 * A2 * D3

x = DX / DS

y = DY / DS

Z = DZ / DS

' salida de datos

txtx.Text = x

txty.Text = y

txtz.Text = Z

End Sub

You might also like