Sub Project_5_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 05_Producto cruz_ES ' Updated: 26/03/24 ' Created by: Ariel R. Becerra (21/11/23) ' Modified by: _________________ ' This is the code of your new project. ' Steps to embed the code to ScienSolar: ' Note 1: The number 5 in the name of this function must match the one in the list of the CONFIG sheet for this project. If not, please correct it. ' Note 2: This code will be integrated into the main code to automate the download of the project. ' Note 3: The formulas and cell values generated here correspond only to the first 30 columns from INICIO to the right in the sheet. All your formulas and values are recommended to be written in these columns. ' Step 1. Go to the CONFIG sheet and add a short name and the number of your new project to the last row in the projects list. ' Step 2. Make sure that the list of projects in CONFIG sheet has the correct ascending numbering. ' Step 4. Open the VBA editor (Alt + F11 in Windows or Fn + Option + F11 in macOS). To avoid mistakes, make sure you only have one workbook open. ' Step 5. On the left, in the project explorer, select a non full module (or add a new one). ' Step 6. Select all the code in this file, copy and paste it at the end of the existing code in the module (or in the new one). ' Step 7. To load the project and to check it in a new sheet, go to the CONFIG sheet and click the New Sheet button, then select the project from the list and click the +Vector button. ' Step 8. Click any XYZ button to get the project in the coordinate system. Enjoy it! ' Visit www.sciensolar.com for news and updates of ? ScienSolar. Cells(m1 - 1, n1 + 2).FormulaR1C1 = "1" Cells(m1 + 0, n1 + 2).FormulaR1C1 = "=CONFIG!R3C4" Cells(m1 + 0, n1 + 3).FormulaR1C1 = "850" Cells(m1 + 0, n1 + 6).FormulaR1C1 = "=CONFIG!R3C8" Cells(m1 + 0, n1 + 7).FormulaR1C1 = "8" Cells(m1 + 0, n1 + 8).FormulaR1C1 = "Ariel R. Becerra (21/11/23)" Cells(m1 + 1, n1 + 2).FormulaR1C1 = "=CONFIG!R4C4" Cells(m1 + 1, n1 + 3).FormulaR1C1 = "400" Cells(m1 + 1, n1 + 4).FormulaR1C1 = "=CONFIG!R4C6" Cells(m1 + 1, n1 + 5).FormulaR1C1 = "0" Cells(m1 + 1, n1 + 6).FormulaR1C1 = "=CONFIG!R4C8" Cells(m1 + 1, n1 + 7).FormulaR1C1 = "45" Cells(m1 + 2, n1 + 2).FormulaR1C1 = "=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 = "20" Cells(m1 + 2, n1 + 4).FormulaR1C1 = "=CONFIG!R5C6" Cells(m1 + 2, n1 + 5).FormulaR1C1 = "15" Cells(m1 + 2, n1 + 6).FormulaR1C1 = "=CONFIG!R5C8" Cells(m1 + 2, n1 + 7).FormulaR1C1 = "0" Cells(m1 + 3, n1 + 0).FormulaR1C1 = "a" Cells(m1 + 3, n1 + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m1 + 3, n1 + 3).FormulaR1C1 = "200" Cells(m1 + 3, n1 + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m1 + 3, n1 + 5).FormulaR1C1 = "735" Cells(m1, n1 + 9).FormulaR1C1 = " ?" Dim HELPtxt As String HELPtxt = "PRODUCTO CRUZ" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " Se llama producto vectorial de dos vectores a y b (se escribe a" & ChrW(233) & " x b) al vector c cuya longitud es igual a |a||b|sin alpha, que corresponde al " & ChrW(225) & "rea del paralelogramo construido sobre estos vectores, y cuya direcci" & ChrW(243) & "n es perpendicular a ambos vectores y se rige por la regla de la mano derecha. Si est" & ChrW(225) & "n dadas las longitudes de los vectores y el " & ChrW(225) & "ngulo entre ellos, entonces se puede hallar el vector" & ChrW(233) & "c. Si los vectores est" & ChrW(225) & "n dados en la forma" & ChrW(233) & "a = (ax,ay,az) y b = (bx,by,bz), entonces el vector c se calcula en coordenadas cartesianas por la f" & ChrW(243) & "rmula:" & ChrW(233) & "" & Chr(10) & _ " a x b = (aybz - azby)i + (azbx - axbz) j+ (axby - aybx)k" & ChrW(233) & "" & Chr(10) & _ " Ingrese las coordenadas iniciales del primer vector en las celdas A10, B10, C10, los incrementos de sus coordenadas en A12, B12, C12. Para el segundo vector correspondientemente en A19, B19, C19" & ChrW(233) & " y A21, B21, C21. El resultado es un vector cuyas coordenadas se observan en las celdas A30, B30, C30 y cuyo origen puede ser modificado a trav" & ChrW(233) & "s de las celdas A28, B28, C28." & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " CROSS PRODUCT" & Chr(10) & _ " The vector product of two vectors a and b (written a x b) is called vector c whose length is equal to |a||b|sin alpha, which corresponds to the area of " & ChrW(233) & "" & ChrW(233) & "the parallelogram built on these vectors, and whose direction is perpendicular to both vectors and is given by the right hand rule. If the lengths of the vectors and the angle between them are given, then vector c can be found. If the vectors are given in the form a = (ax,ay,az) and b = (bx,by,bz), then the vector c is calculated in Cartesian coordinates using the formula:" & Chr(10) & _ " a x b = (aybz - azby)i + (azbx - axbz)j+ (axby - aybx)k" & Chr(10) & _ " Enter the initial coordinates of the first vector in cells A10, B10, C10, the increments of its coordinates in A12, B12, C12. For the second vector correspondingly in A19, B19, C19 and A21, B21, C21. The result is a vector whose coordinates are observed in cells A30, B30, C30 and whose origin can be changed through cells A28, B28, C28." Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "a" Cells(m + 3, n + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m + 3, n + 3).FormulaR1C1 = "200" Cells(m + 3, n + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m + 3, n + 5).FormulaR1C1 = "735" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Cross product" Cells(m + 4, n + 12).FormulaR1C1 = "PRODUCTO VECTORIAL DE DOS VECTORES" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCCIONES" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 6, n + -1).FormulaR1C1 = "aox" Cells(m + 6, n + 0).FormulaR1C1 = "aoy" Cells(m + 6, n + 1).FormulaR1C1 = "aoz" Cells(m + 7, n + -1).FormulaR1C1 = "2" Cells(m + 7, n + 0).FormulaR1C1 = "4" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-7]C+R[-9]C" Cells(m + 7, n + 4).FormulaR1C1 = " | a x b | =" Cells(m + 7, n + 5).FormulaR1C1 = "=ROUND(SQRT(R[20]C[-6]^2+R[20]C[-5]^2+R[20]C[-4]^2),2)" Cells(m + 7, n + 21).FormulaR1C1 = "Se llama producto vectorial de dos vectores a y b (se escribe a x b) al vector c cuya longitud es" Cells(m + 8, n + -1).FormulaR1C1 = "ax" Cells(m + 8, n + 0).FormulaR1C1 = "ay" Cells(m + 8, n + 1).FormulaR1C1 = "az" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "(Eq-5-2)" Cells(m + 8, n + 21).FormulaR1C1 = "igual al producto de las magnitudes de los vectores por el seno del " & ChrW(225) & "ngulo entre ellos y " Cells(m + 9, n + -1).FormulaR1C1 = "2" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "0" Cells(m + 9, n + 2).FormulaR1C1 = "<< --- a" Cells(m + 9, n + 21).FormulaR1C1 = "cuya direcci" & ChrW(243) & "n es perpendicular a ambos vectores y se rige por la regla de la mano derecha. Si est" & ChrW(225) & "n " Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "dadas las longitudes de los vectores y el " & ChrW(225) & "ngulo alpha entre ellos, entonces se puede hallar el vector " Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "c determinando su direcci" & ChrW(243) & "n por la regla de la mano derecha y su magnitud por la f" & ChrW(243) & "rmula ab Seno alpha. " Cells(m + 3, n + 1).Interior.Color = "11892015" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "b" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "b" Cells(m + 3, n + 21).FormulaR1C1 = "Por otra parte, si los vectores est" & ChrW(225) & "n dados en la forma " Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 27).FormulaR1C1 = "(Eq-3-2)" Cells(m + 6, n + -1).FormulaR1C1 = "box" Cells(m + 6, n + 0).FormulaR1C1 = "boy" Cells(m + 6, n + 1).FormulaR1C1 = "boz" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-9]C" Cells(m + 8, n + -1).FormulaR1C1 = "bx" Cells(m + 8, n + 0).FormulaR1C1 = "by" Cells(m + 8, n + 1).FormulaR1C1 = "bz" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "entonces el vector c se calcula en coordenadas cartesianas por la f" & ChrW(243) & "rmula: " Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "3" Cells(m + 9, n + 2).FormulaR1C1 = "<< --- b" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 27).FormulaR1C1 = "(Eq-5-1)" Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "49407" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "a x b" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "3" Cells(m + 3, n + 0).FormulaR1C1 = "a x b" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "LAS COORDENADAS DEL PRIMER VECTOR SE CAMBIAN EN:" Cells(m + 6, n + -1).FormulaR1C1 = "a x box" Cells(m + 6, n + 0).FormulaR1C1 = "a x boy" Cells(m + 6, n + 1).FormulaR1C1 = "a x boz" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 22).FormulaR1C1 = "a_ox en la celda A10" Cells(m + 8, n + -1).FormulaR1C1 = "a x bx" Cells(m + 8, n + 0).FormulaR1C1 = "a x by" Cells(m + 8, n + 1).FormulaR1C1 = "a x bz" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 22).FormulaR1C1 = "a_oy en la celda B10" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-18]C[1]*R[-9]C[2]-R[-18]C[2]*R[-9]C[1]" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-18]C[-1]*R[-9]C[1]+R[-18]C[1]*R[-9]C[-1]" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-18]C[-2]*R[-9]C[-1]-R[-18]C[-1]*R[-9]C[-2]" Cells(m + 9, n + 2).FormulaR1C1 = "(Eq-5-1)" Cells(m + 9, n + 22).FormulaR1C1 = "a_oz en la celda C10" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 22).FormulaR1C1 = "a_x en la celda A12" Cells(m + 3, n + 1).Interior.Color = "255" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Cells(m1 + 2, n1 - 1).Value = 3 End If ' vector ends If m = m1 + 18 Then Cells(m + 12, n + 22).FormulaR1C1 = "a_y en la celda B12" Cells(m + 13, n + 22).FormulaR1C1 = "a_z en la celda C12" Cells(m + 15, n + 21).FormulaR1C1 = "LAS COORDENADAS DEL SEGUNDO VECTOR VECTOR SE CAMBIAN EN:" Cells(m + 17, n + 22).FormulaR1C1 = "b_ox en la celda A19" Cells(m + 18, n + 22).FormulaR1C1 = "b_oy en la celda B19" Cells(m + 19, n + 22).FormulaR1C1 = "b_oz en la celda C19" Cells(m + 21, n + 22).FormulaR1C1 = "b_x en la celda A21" Cells(m + 22, n + 22).FormulaR1C1 = "b_y en la celda B21" Cells(m + 23, n + 22).FormulaR1C1 = "b_z en la celda C21" Cells(m + 25, n + 21).FormulaR1C1 = "La magnitud del vector resultante a x b se muestra en la celda G10." Cells(m + 26, n + 21).FormulaR1C1 = "Las coordenadas del vector resultante se encuentran en las celdas A30, B30 y C30. Oprima el bot" & ChrW(243) & "n" Cells(m + 27, n + 21).FormulaR1C1 = "ubicado en D31 para ver las ecuaciones que tienen lugar para sus componentes. " Cells(m + 29, n + 21).FormulaR1C1 = "EJEMPLO 1. Dados los vectores a = (2,0,0), b = (0,0,3), hallar c = a x b. Soluci" & ChrW(243) & "n: ingrese A12=2," Cells(m + 30, n + 21).FormulaR1C1 = " B12=0, C12=0, y A21=0, B21=0, C21=3. Oprima XYZ. Observar" & ChrW(225) & " las componentes del vector c " Cells(m + 31, n + 21).FormulaR1C1 = "en las celdas A30=0, B30=6 , C30=0. Experimente con otros valores para las coordenadas de " Cells(m + 32, n + 21).FormulaR1C1 = "los vectores, incluyendo valores negativos, decimales y m" & ChrW(250) & "ltiplos de un par" & ChrW(225) & "metro (en este " & ChrW(250) & "ltimo " Cells(m + 33, n + 21).FormulaR1C1 = "caso, el par" & ChrW(225) & "metros se puede escribir en una celda de la columna G). " Cells(m + 34, n + 21).FormulaR1C1 = "Oprima XYZ para ver los resultados. Oprima C para rotar el sistema de coordenadas " Cells(m + 35, n + 21).FormulaR1C1 = "y utilice YZ, XZ y XY para ver los vectores desde diferentes planos, observe c" & ChrW(243) & "mo se comportan las " Cells(m + 36, n + 21).FormulaR1C1 = "coordenadas tanto del vector resultante como de los vectores multiplicando." Cells(m + 38, n + 21).FormulaR1C1 = "EJERCICIO 1. Hallar i x j, en donde i, j son versores del sistema cartesiano." Cells(m + 39, n + 21).FormulaR1C1 = "EJERCICIO 2. Hallar j x i, en donde i, j son versores del sistema cartesiano." Cells(m + 40, n + 21).FormulaR1C1 = "EJERCICIO 3. Hallar k x j, en donde k, j son versores del sistema cartesiano." Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub