Sub Project_9_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 09_Rotcion tangencial_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 9 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 = "=CONFIG!R4C7" 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 = "=CONFIG!R5C7" Cells(m1 + 2, n1 + 6).FormulaR1C1 = "=CONFIG!R5C8" Cells(m1 + 2, n1 + 7).FormulaR1C1 = "360" 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 = "=CONFIG!R6C7" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt As String HELPtxt = "ROTACI" & ChrW(211) & "N TANGENCIAL DE UN VECTOR ALREDEDOR DE UN VECTOR UNITARIO" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " Un vector B que es perpendicular al radio de rotaci" & ChrW(243) & "n r y al eje de rotaci" & ChrW(243) & "n con vector unitario u se puede hallar por el producto cruz B = u x r, siendo el vector unitario un vector de magnitud 1 y direcci" & ChrW(243) & "n la misma del vector A." & Chr(10) & _ " Modifique los valores del vector auxiliar A en las celdas G11, G12, G13 y G16 y 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) & _ " TANGENTIAL ROTATION OF A VECTOR ABOUT A UNIT VECTOR" & Chr(10) & _ " A vector B that is perpendicular to the radius of rotation r and to the axis of rotation with the unit vector u can be found by the cross product B = u x r, where the unit vector is a vector of magnitude 1 and in the same direction as vector A." & Chr(10) & _ " Modify the values " & ChrW(233) & "" & ChrW(233) & "of the auxiliary vector A in cells G11, G12, G13, G16 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) & _ " " Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 5 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 = "=CONFIG!R6C7" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Rotaci" & ChrW(243) & "n tangencial" Cells(m + 4, n + 12).FormulaR1C1 = "ROTACI" & ChrW(211) & "N TANGENCIAL ALREDEDOR DE UN EJE" 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" Cells(m + 6, n + 4).FormulaR1C1 = "Coordenadas del radio r:" Cells(m + 7, n + -1).FormulaR1C1 = "4" Cells(m + 7, n + 0).FormulaR1C1 = "4" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "<-- Posici" & ChrW(243) & "n " 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 = "1. La posici" & ChrW(243) & "n inicial y las coordenadas del eje se modifican en:" 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 = "<-- Inclinaci" & ChrW(243) & "n" Cells(m + 9, n + 4).FormulaR1C1 = " y =" Cells(m + 9, n + 5).FormulaR1C1 = "4" Cells(m + 9, n + 22).FormulaR1C1 = "a_ox en la celda A10" 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 + 22).FormulaR1C1 = "a_oy en la celda B10" 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_oz en la celda C10" Cells(m + 3, n + 1).Interior.Color = "16711680" 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 4 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 + 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_x en la celda A12" 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 + 2).FormulaR1C1 = "=1-COS(RADIANS(R[-12]C[5]))" Cells(m + 5, n + 4).FormulaR1C1 = "(oprima luego Ejecutar.)" Cells(m + 5, n + 22).FormulaR1C1 = "a_y en la celda B12" Cells(m + 6, n + 22).FormulaR1C1 = "a_z en la celda C12" 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 + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, 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 + 9, n + -1).FormulaR1C1 = "=R[-9]C/SQRT(R[-9]C*R[-9]C+R[-9]C[1]*R[-9]C[1]+R[-9]C[2]*R[-9]C[2])" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C/SQRT(R[-9]C[-1]*R[-9]C[-1]+R[-9]C*R[-9]C+R[-9]C[1]*R[-9]C[1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C/SQRT(R[-9]C[-2]*R[-9]C[-2]+R[-9]C[-1]*R[-9]C[-1]+R[-9]C*R[-9]C)" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, 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 + 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 = " coordenadas se hallan de acuerdo a la f" & ChrW(243) & "rmula de rotaci" & ChrW(243) & "n para el nuevo vector:" 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 + 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 = "" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "3" Cells(m + 3, n + 27).FormulaR1C1 = "(Eq-7-1)" 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 + 22).FormulaR1C1 = "en donde theta es el " & ChrW(225) & "ngulo a rotar." Cells(m + 6, n + 21).FormulaR1C1 = "El vector B tangente se obtiene multiplicando vectorialmente B = u x r" 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 + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 27).FormulaR1C1 = "(Eq-8-1)" 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 = "<-- Radio de la circunferencia" 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 = "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 + 21).FormulaR1C1 = "Utilice los botones de Ejecutar simulaci" & ChrW(243) & "n para ver la rotaci" & ChrW(243) & "n del vector. " 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 = "r" Call AddNewVector End If ' vector ends If m = m1 + 27 Then ' vector 2 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 + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0" 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 + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" 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 + 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 = "4" 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 = "B" Call AddNewVector End If ' vector ends If m = m1 + 36 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "5" Cells(m + 3, n + 0).FormulaR1C1 = "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 + 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 + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-27]C[1]*R[-9]C[2]-R[-27]C[2]*R[-9]C[1]" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-27]C[-1]*R[-9]C[1]+R[-27]C[1]*R[-9]C[-1]" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-27]C[-2]*R[-9]C[-1]-R[-27]C[-1]*R[-9]C[-2]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "=R[-33]C[4]" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" 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 + 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 = 5 End If ' vector ends If m = m1 + 36 Then Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub