Sub Project_7_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 07_Rotacion de un vector_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 7 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 = "15" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt As String HELPtxt = "ROTACI" & ChrW(211) & "N DE UN VECTOR ALREDEDOR DE UN VECTOR UNITARIO" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " Modifique los valores del vector en las celdas G11, G12 y G13 observe los resultados oprimiendo el bot" & ChrW(243) & "n Run. Esto lo puede ver desde diferentes perspectivas con los botones de coordenadas XYZ, YZ, XZ, XY." & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " ROTATION OF A VECTOR ABOUT A UNIT VECTOR" & Chr(10) & _ " Modify the values " & ChrW(233) & "" & ChrW(233) & "of the auxiliary vector a in cells G11, G12 y G13 and observe the results by pressing the Run button. You can see this from different perspectives with the XYZ, YZ, XZ, XY coordinate buttons." & Chr(10) & _ " " & Chr(10) & _ " " Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 4 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 = "15" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Rotaci" & ChrW(243) & "n alrededor de un vector unitario" Cells(m + 4, n + 12).FormulaR1C1 = "ROTACI" & ChrW(211) & "N ALREDEDOR DE UN EJE CON VECTOR UNITARIO" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCCIONES" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" 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 = "3" Cells(m + 7, n + 0).FormulaR1C1 = "3" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-7]C+R[-9]C" Cells(m + 7, n + 4).FormulaR1C1 = "Coordenadas del radio r:" Cells(m + 7, n + 21).FormulaR1C1 = "El modelo muestra las ecuaciones para la construcci" & ChrW(243) & "n de un vector que rota alrededor de un " 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 = " x =" Cells(m + 8, n + 5).FormulaR1C1 = "2" Cells(m + 8, n + 21).FormulaR1C1 = "vector unitario. Este modelo se puede usar como base para la construcci" & ChrW(243) & "n de otros modelos " Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "4" Cells(m + 9, n + 2).FormulaR1C1 = "<< ---" Cells(m + 9, n + 4).FormulaR1C1 = " y =" Cells(m + 9, n + 5).FormulaR1C1 = "4" Cells(m + 9, n + 21).FormulaR1C1 = "matem" & ChrW(225) & "ticos o f" & ChrW(237) & "sicos." 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 = " z =" Cells(m + 10, n + 5).FormulaR1C1 = "0" Cells(m + 10, n + 21).FormulaR1C1 = "La posici" & ChrW(243) & "n inicial y las coordenadas del eje se modifican en:" Cells(m + 11, n + -1).FormulaR1C1 = "1" 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_ox en la celda A10" Cells(m + 3, n + 1).Interior.Color = "36799" 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 = "u" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "u" Cells(m + 3, n + 4).FormulaR1C1 = "Fijar trayectoria (1 o 2):" Cells(m + 3, n + 22).FormulaR1C1 = "a_oy en la celda B10" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "=SIN(RADIANS(R[-11]C[5]))" Cells(m + 4, n + 5).FormulaR1C1 = "1" Cells(m + 4, n + 22).FormulaR1C1 = "a_oz en la celda C10" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 2).FormulaR1C1 = "=1-COS(RADIANS(R[-12]C[5]))" Cells(m + 6, n + -1).FormulaR1C1 = "uox" Cells(m + 6, n + 0).FormulaR1C1 = "uoy" Cells(m + 6, n + 1).FormulaR1C1 = "uoz" Cells(m + 6, n + 22).FormulaR1C1 = "a_x en la celda A12" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-7]C+R[-9]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-7]C+R[-9]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-7]C+R[-9]C" Cells(m + 7, n + 22).FormulaR1C1 = "a_y en la celda B12" Cells(m + 8, n + -1).FormulaR1C1 = "ux" Cells(m + 8, n + 0).FormulaR1C1 = "uy" Cells(m + 8, n + 1).FormulaR1C1 = "uz" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 22).FormulaR1C1 = "a_z en la celda C12" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C/SQRT(R[-9]C^2+R[-9]C[1]^2+R[-9]C[2]^2)" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C/SQRT(R[-9]C[-1]^2+R[-9]C^2+R[-9]C[1]^2)" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C/SQRT(R[-9]C[-2]^2+R[-9]C[-1]^2+R[-9]C^2)" Cells(m + 9, n + 2).FormulaR1C1 = "(Eq-6-1)" 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 = "El vector a rotar r_P es el vector n" & ChrW(250) & "mero 3 y sus coordenadas se establecen en las celdas G11, G12 " 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 = " y G13. El vector rotado r alrededor del vector unitario u es el n" & ChrW(250) & "mero 4 y las ecuaciones para sus" 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 = "" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "3" Cells(m + 3, n + 21).FormulaR1C1 = " coordenadas se hallan de acuerdo a la f" & ChrW(243) & "rmula de rotaci" & ChrW(243) & "n para el nuevo vector:" 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 = "1" Cells(m + 5, n + 27).FormulaR1C1 = "(Eq-7-1)" Cells(m + 6, n + -1).FormulaR1C1 = "roox" Cells(m + 6, n + 0).FormulaR1C1 = "rooy" Cells(m + 6, n + 1).FormulaR1C1 = "rooz" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 22).FormulaR1C1 = "en donde theta es el " & ChrW(225) & "ngulo a rotar." Cells(m + 8, n + -1).FormulaR1C1 = "Coordenadas del vector" Cells(m + 8, n + 0).FormulaR1C1 = "y" Cells(m + 8, n + 1).FormulaR1C1 = "z" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 22).FormulaR1C1 = "(La explicaci" & ChrW(243) & "n detallada de la matem" & ChrW(225) & "tica se puede obtener en el manual)." Cells(m + 9, n + -1).FormulaR1C1 = "=R[-19]C[6]" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-18]C[5]" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-17]C[4]" Cells(m + 9, n + 2).FormulaR1C1 = "<< ---" Cells(m + 9, n + 21).FormulaR1C1 = "Utilice los botones de Ejecutar simulaci" & ChrW(243) & "n para ver la rotaci" & ChrW(243) & "n del vector. " 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 = "Utilice G16=2 para congelar el recorrido del vector despu" & ChrW(233) & "s de ejecutar la simulaci" & ChrW(243) & "n." Cells(m + 11, n + -1).FormulaR1C1 = "0" 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 = "Oprima el bot" & ChrW(243) & "n ubicado en D40 para ver las ecuaciones de las componentes del vector r." Cells(m + 3, n + 1).Interior.Color = "12611584" 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 = "r" Call AddNewVector End If ' vector ends If m = m1 + 27 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "4" Cells(m + 3, n + 0).FormulaR1C1 = "r" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "EJEMPLO 1. Obtener la simulaci" & ChrW(243) & "n de una part" & ChrW(237) & "cula puntual que est" & ChrW(225) & " rotando alrededor del eje y " Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 21).FormulaR1C1 = "con un radio r=5 con origen en y_0=4. Soluci" & ChrW(243) & "n: Se parte del modelo actual y se modifica la orientaci" & ChrW(243) & "n " Cells(m + 6, n + -1).FormulaR1C1 = "rox" Cells(m + 6, n + 0).FormulaR1C1 = "roy" Cells(m + 6, n + 1).FormulaR1C1 = "roz" Cells(m + 6, n + 21).FormulaR1C1 = "del eje y del radio, para ello se introduce A10=0, B10=0 y C10=0. El centro de rotaci" & ChrW(243) & "n se ubica en " 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 + 7, n + 21).FormulaR1C1 = "B12=4 y el radio de rotaci" & ChrW(243) & "n en G11=5, G12=0, G13=0. Oprima Ejecutar para ver la rotaci" & ChrW(243) & "n. Para " Cells(m + 8, n + -1).FormulaR1C1 = "rx" Cells(m + 8, n + 0).FormulaR1C1 = "ry" Cells(m + 8, n + 1).FormulaR1C1 = "rz" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "agregar la part" & ChrW(237) & "cula, verifique que no haya seleccionado ning" & ChrW(250) & "n proyecto en la lista de proyectos y " Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C+R[-22]C[3]*(R[-18]C[1]*R[-18]C*R[-9]C[1]-R[-18]C[1]*R[-18]C[1]*R[-9]C+R[-18]C[2]*R[-18]C*R[-9]C[2]-R[-18]C[2]*R[-18]C[2]*R[-9]C)+R[-23]C[3]*(R[-18]C[1]*R[-9]C[2]-R[-18]C[2]*R[-9]C[1])" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C+R[-22]C[2]*(-R[-18]C[-1]*R[-18]C[-1]*R[-9]C+R[-18]C[-1]*R[-18]C*R[-9]C[-1]+R[-18]C[1]*R[-18]C*R[-9]C[1]-R[-18]C[1]*R[-18]C[1]*R[-9]C)+R[-23]C[2]*(-R[-18]C[-1]*R[-9]C[1]+R[-18]C[1]*R[-9]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C+R[-22]C[1]*(-R[-18]C[-2]*R[-18]C[-2]*R[-9]C+R[-18]C[-2]*R[-18]C*R[-9]C[-2]-R[-18]C[-1]*R[-18]C[-1]*R[-9]C+R[-18]C[-1]*R[-18]C*R[-9]C[-1])+R[-23]C[1]*(R[-18]C[-2]*R[-9]C[-1]-R[-18]C[-1]*R[-9]C[-2])" Cells(m + 9, n + 2).FormulaR1C1 = "(Eq-7-2)" Cells(m + 9, n + 21).FormulaR1C1 = "oprima el bot" & ChrW(243) & "n +Vector. En la ventana emergente indique el nombre Q para el nuevo vector, luego " Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "=R[-24]C[4]" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "en B43=146 para convertir el vector a un punto; cambie el color del nuevo vector a un rojo encendido " Cells(m + 11, n + -1).FormulaR1C1 = "2" 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 = "y en C50=8 para aumentar el tamaŠo de la part" & ChrW(237) & "cula, C35=1, para ocultar el radio. Oprima Ejecutar y podr" & ChrW(225) & " " Cells(m + 3, n + 1).Interior.Color = "12611584" 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 = 4 End If ' vector ends If m = m1 + 27 Then Cells(m + 12, n + 21).FormulaR1C1 = "observar la part" & ChrW(237) & "cula rotando alrededor del eje y. H" & ChrW(225) & "gala rotar desde diferentes planos. Introduzca " Cells(m + 13, n + 21).FormulaR1C1 = "C49=2 y oprima Ejecutar para ver la trayectoria de la part" & ChrW(237) & "cula; repita la operaci" & ChrW(243) & "n con C49=1." Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub