SP_LP_Geraden2P(g11, g12, g21, g22, LP)

Mittwoch, 19.7.2017, 11:23 > daMax

Du weißt, dein Tag wird anstregend, wenn dir schon am frühen Morgen sowas unter die Linse kommt:

Sub SP_LP_Geraden2P(g11, g12, g21, g22, LP)
   Dim VD1(2)
   Dim VD2(2)
   Dim VD3(2)
   Dim VD4(2)
   
   Dim n11(2)
   Dim n12(2)
   Dim n21(2)
   Dim n22(2)
   
   Dim M1(11)
   Dim M2(11)
   Dim M3(11)
   Dim M4(11)
   
   Dim lp0
   Dim dval        As Double
   
   Dim lpM(2)
'#--------------------------------------------------------------------------------------
'#--------------------------------------------------------------------------------------
   
   VSubDir g12, g11, VD1
   VSubDir g22, g21, VD2
   
   VDot VD1, VD2, dval
   
   If dval > 0.99999 Then
     MsgBox "Vektoren parallel"
      
      LP(0) = g12(0)
      LP(1) = g12(1)
      LP(2) = g12(2)
      
    
    
   Else
       VCross VD1, VD2, VD3
       VCross VD3, VD1, VD4
       
       M43FillV3 VD1, VD4, VD3, g11, M1
       M43Inv M1, M2
       
       M43_V3mult g11, M2, n11
       M43_V3mult g12, M2, n12
       M43_V3mult g21, M2, n21
       M43_V3mult g22, M2, n22
       
       V2GcutX n21(0), n21(1), n22(0), n22(1), lp0
       
       lpM(0) = lp0
       lpM(1) = 0
       lpM(2) = n22(2)
   
       M43_V3mult lpM, M1, LP
   End If
    
    
End Sub

So und ähnlich geht das seitenweise weiter :(