Pages

About Me

My photo
Morgantown, West Virginia, United States
As a visionary person, I can realize what will happen next. Answers come from inner soul during meditation. I believe that I am a time traveler. Sometimes, I am a son, a brother, a friend, a student, and a loving husband. Text books have shaped my scientific and artistic views, my passion to study history, novel, politics, and philosophy, create me an introspective person. The distress of life made me a retrospective person. The teachings of Vivekananda and Vedanta have figured my wisdom and views. This life is a chapter of an unknown book. However, I believe that the book also has a joyous conclusion. The happy ending of the traveler may be the happy beginning of something that nobody knows. I have a dream; the divine infinite will call me one day to go back to my home. Now I am waiting for that moment. The chapter of the traveler will finish one day but this blog will tell the story of the traveler to the future being.

Jul 9, 2010

My complete Visual Basic Coding for Hip joint Biomechanics ( Vector geometry)

Sub copy_data()
Application.ScreenUpdating = False
Worksheets("Selected markers").Range("B1:G500").Value = Worksheets("raw").Range("BS1:BX500").Value
Worksheets("Selected markers").Range("H1:J500").Value = Worksheets("raw").Range("CT1:CV500").Value
Worksheets("Selected markers").Range("K1:M500").Value = Worksheets("raw").Range("DL1:DN500").Value
Worksheets("Selected markers").Range("N1:P500").Value = Worksheets("raw").Range("CN1:CP500").Value
Worksheets("Selected markers").Range("Q1:S500").Value = Worksheets("raw").Range("DF1:DH500").Value
Worksheets("Selected markers").Range("T1:V500").Value = Worksheets("raw").Range("AC1:AE500").Value
Worksheets("Selected markers").Range("W1:Y500").Value = Worksheets("raw").Range("AX1:AZ500").Value
Worksheets("Selected markers").Range("Z1:AB500").Value = Worksheets("raw").Range("Q1:S500").Value
Worksheets("Selected markers").Range("AC1:AE500").Value = Worksheets("raw").Range("W1:Y500").Value
Worksheets("Selected markers").Range("AF1:AH500").Value = Worksheets("raw").Range("DX1:DZ500").Value
Worksheets("Selected markers").Range("AI1:AN500").Value = Worksheets("raw").Range("DO1:DT500").Value
Worksheets("Selected markers").Range("A1:A500").Value = Worksheets("raw").Range("A1:A500").Value
Application.ScreenUpdating = True
End Sub
Sub THETA_L()

Dim LastRow As Long
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row

End If

For i = 4 To LastRow


Cells(i, 41) = Cells(i, 2) - Cells(i, 8)

Cells(i, 42) = Cells(i, 3) - Cells(i, 9)

Cells(i, 43) = Cells(i, 4) - Cells(i, 10)

Cells(i, 44) = Cells(i, 41) * Cells(i, 41)

Cells(i, 45) = Cells(i, 42) * Cells(i, 42)

Cells(i, 46) = Cells(i, 43) * Cells(i, 43)

Cells(i, 47) = Cells(i, 44) + Cells(i, 45) + Cells(i, 46)

Cells(i, 48) = Cells(i, 47) ^ (1 / 2)

Cells(i, 49) = Cells(i, 43) / Cells(i, 48)

Cells(i, 50) = WorksheetFunction.Acos(Cells(i, 49))

Cells(i, 51) = ((Cells(i, 50)) * 180) / 3.14

'theta_R

Cells(i, 53) = Cells(i, 5) - Cells(i, 11)

Cells(i, 54) = Cells(i, 6) - Cells(i, 12)

Cells(i, 55) = Cells(i, 7) - Cells(i, 13)

Cells(i, 56) = Cells(i, 53) * Cells(i, 53)

Cells(i, 57) = Cells(i, 54) * Cells(i, 54)

Cells(i, 58) = Cells(i, 55) * Cells(i, 55)

Cells(i, 59) = Cells(i, 56) + Cells(i, 57) + Cells(i, 58)

Cells(i, 60) = Cells(i, 59) ^ (1 / 2)

Cells(i, 61) = Cells(i, 55) / Cells(i, 60)

Cells(i, 62) = WorksheetFunction.Acos(Cells(i, 61))

Cells(i, 63) = ((Cells(i, 62)) * 180) / 3.14

'theta_LP


Cells(i, 65) = Cells(i, 35) - Cells(i, 14)

Cells(i, 66) = Cells(i, 36) - Cells(i, 15)

Cells(i, 67) = Cells(i, 37) - Cells(i, 16)

Cells(i, 68) = Cells(i, 65) * Cells(i, 65)

Cells(i, 69) = Cells(i, 66) * Cells(i, 66)

Cells(i, 70) = Cells(i, 67) * Cells(i, 67)

Cells(i, 71) = Cells(i, 68) + Cells(i, 69) + Cells(i, 70)

Cells(i, 72) = Cells(i, 71) ^ (1 / 2)

Cells(i, 73) = Cells(i, 67) / Cells(i, 72)

Cells(i, 74) = WorksheetFunction.Acos(Cells(i, 73))

Cells(i, 75) = ((Cells(i, 74)) * 180) / 3.14

'theta_Rp


Cells(i, 77) = Cells(i, 38) - Cells(i, 17)

Cells(i, 78) = Cells(i, 39) - Cells(i, 18)

Cells(i, 79) = Cells(i, 40) - Cells(i, 41)

Cells(i, 80) = Cells(i, 77) * Cells(i, 77)

Cells(i, 81) = Cells(i, 78) * Cells(i, 78)

Cells(i, 82) = Cells(i, 79) * Cells(i, 79)

Cells(i, 83) = Cells(i, 80) + Cells(i, 81) + Cells(i, 82)

Cells(i, 84) = Cells(i, 83) ^ (1 / 2)

Cells(i, 85) = Cells(i, 79) / Cells(i, 84)

Cells(i, 86) = WorksheetFunction.Acos(Cells(i, 85))

Cells(i, 87) = ((Cells(i, 86)) * 180) / 3.14


'dia L


Cells(i, 89) = Cells(i, 2) - Cells(i, 20)

Cells(i, 90) = Cells(i, 3) - Cells(i, 21)

Cells(i, 91) = Cells(i, 4) - Cells(i, 22)

Cells(i, 92) = Cells(i, 89) * Cells(i, 89)

Cells(i, 93) = Cells(i, 90) * Cells(i, 90)

Cells(i, 94) = Cells(i, 91) * Cells(i, 91)

Cells(i, 95) = Cells(i, 92) + Cells(i, 93) + Cells(i, 94)

Cells(i, 96) = Cells(i, 95) ^ (1 / 2)


'dia R

Cells(i, 98) = Cells(i, 5) - Cells(i, 23)

Cells(i, 99) = Cells(i, 6) - Cells(i, 24)

Cells(i, 100) = Cells(i, 7) - Cells(i, 25)

Cells(i, 101) = Cells(i, 98) * Cells(i, 98)

Cells(i, 102) = Cells(i, 99) * Cells(i, 99)

Cells(i, 103) = Cells(i, 100) * Cells(i, 100)

Cells(i, 104) = Cells(i, 101) + Cells(i, 102) + Cells(i, 103)

Cells(i, 105) = Cells(i, 104) ^ (1 / 2)

'delthetaL A


Cells(i, 107) = Cells(i, 2) - Cells(i, 5)

Cells(i, 108) = Cells(i, 3) - Cells(i, 6)

Cells(i, 109) = Cells(i, 4) - Cells(i, 7)

Cells(i, 110) = Cells(i, 107) * Cells(i, 107)

Cells(i, 111) = Cells(i, 108) * Cells(i, 108)

Cells(i, 112) = Cells(i, 109) * Cells(i, 109)

Cells(i, 113) = Cells(i, 110) + Cells(i, 111) + Cells(i, 112)

Cells(i, 114) = Cells(i, 113) ^ (1 / 2)

Cells(i, 115) = Cells(i, 20) - Cells(i, 23)

Cells(i, 116) = Cells(i, 21) - Cells(i, 24)

Cells(i, 117) = Cells(i, 22) - Cells(i, 25)

Cells(i, 118) = Cells(i, 115) * Cells(i, 115)

Cells(i, 119) = Cells(i, 116) * Cells(i, 116)

Cells(i, 120) = Cells(i, 117) * Cells(i, 117)

Cells(i, 121) = Cells(i, 118) + Cells(i, 119) + Cells(i, 120)

Cells(i, 122) = Cells(i, 121) ^ (1 / 2)

Cells(i, 123) = Cells(i, 107) * Cells(i, 115) + Cells(i, 108) * Cells(i, 116) + Cells(i, 109) * Cells(i, 117)

Cells(i, 125) = Cells(i, 123) / (Cells(i, 114) * Cells(i, 122))

Cells(i, 126) = WorksheetFunction.Acos(Cells(i, 125))

Cells(i, 127) = ((Cells(i, 126)) * 180) / 3.14

'del_LT

Cells(i, 129) = Cells(i, 2) - Cells(i, 32)
Cells(i, 130) = Cells(i, 3) - Cells(i, 33)
Cells(i, 131) = Cells(i, 4) - Cells(i, 34)
Cells(i, 132) = Cells(i, 5) - Cells(i, 32)
Cells(i, 133) = Cells(i, 6) - Cells(i, 33)
Cells(i, 134) = Cells(i, 7) - Cells(i, 34)

Cells(i, 136) = Cells(i, 29) - Cells(i, 26)
Cells(i, 137) = Cells(i, 30) - Cells(i, 27)
Cells(i, 138) = Cells(i, 31) - Cells(i, 28)

Cells(i, 140) = Cells(i, 129) * Cells(i, 129)
Cells(i, 141) = Cells(i, 130) * Cells(i, 130)
Cells(i, 142) = Cells(i, 131) * Cells(i, 131)
Cells(i, 143) = Cells(i, 132) * Cells(i, 132)
Cells(i, 144) = Cells(i, 133) * Cells(i, 133)
Cells(i, 145) = Cells(i, 134) * Cells(i, 134)

Cells(i, 147) = Cells(i, 140) + Cells(i, 141) + Cells(i, 142)
Cells(i, 149) = Cells(i, 143) + Cells(i, 144) + Cells(i, 145)
Cells(i, 148) = Cells(i, 147) ^ (1 / 2)
Cells(i, 150) = Cells(i, 149) ^ (1 / 2)

Cells(i, 152) = Cells(i, 136) * Cells(i, 136)
Cells(i, 153) = Cells(i, 137) * Cells(i, 137)
Cells(i, 154) = Cells(i, 138) * Cells(i, 138)
Cells(i, 155) = Cells(i, 152) + Cells(i, 153) + Cells(i, 154)
Cells(i, 156) = Cells(i, 155) ^ (1 / 2)


Cells(i, 158) = Cells(i, 129) - Cells(i, 136)
Cells(i, 159) = Cells(i, 130) - Cells(i, 137)
Cells(i, 160) = Cells(i, 131) - Cells(i, 138)
Cells(i, 161) = Cells(i, 132) - Cells(i, 136)
Cells(i, 162) = Cells(i, 133) - Cells(i, 137)
Cells(i, 163) = Cells(i, 134) - Cells(i, 138)

Cells(i, 165) = Cells(i, 158) * Cells(i, 158)
Cells(i, 166) = Cells(i, 159) * Cells(i, 159)
Cells(i, 167) = Cells(i, 160) * Cells(i, 160)
Cells(i, 168) = Cells(i, 161) * Cells(i, 161)
Cells(i, 169) = Cells(i, 162) * Cells(i, 162)
Cells(i, 170) = Cells(i, 163) * Cells(i, 163)

Cells(i, 172) = Cells(i, 165) + Cells(i, 166) + Cells(i, 167)
Cells(i, 174) = Cells(i, 168) + Cells(i, 169) + Cells(i, 170)
Cells(i, 173) = Cells(i, 172) ^ (1 / 2)
Cells(i, 175) = Cells(i, 174) ^ (1 / 2)


Next i

ActiveWorkbook.Save

End Sub

No comments: