Welcome! Log In Create A New Profile

Advanced
Re: Summing matrices
July 05, 2014 05:36PM
Hi Michael,

Here's some pseudo-code. I don't think an excel spreadsheet would tell you anything much.

Quote
Michael Horvath
I know that the XYZ coordinates can simply be added.

Actually no they cannot. You must rotate the displacement of C relative to B.

Tim


# Multiply a vector by a matrix
function Xn=MatVec(R,X)
   for i from 1 to 3
      Xn(i)=0
      for j from 1 to 3
         Xn(i)=Xn(i)+R(i,j)*X(j)
      end
   end
endfunction

# Multiply two matrices
function Rn=MatMat(R1,R2)
   for i from 1 to 3
      for j from 1 to 3
         Rn(i,j)=0
         for k from 1 to 3
            Rn(i,j)=Rn(i,j)+R1(i,k)*R2(k,j)
         end
      end
   end
endfunction

# Find the rotation and displacement of A relative to C [XCA and RCA]
# using # the rotation and displacement of A relative to B [XBA and RBA]
# and B relative to C [XCB and RCB]
function [XCA,RCA]=Compound(XBA,RBA,XCB,RCB)
   RCA=MatMat(RCB,RBA)
   XCBp=MatVec(RBA,XCB)

   for i from 1 to 3
      XCA(i)=XBA(i) + XCBp(i)
   end
endfunction


Edited 2 time(s). Last edit at 2014-07-05 05:38PM by Tim Gould.
SubjectAuthorViewsPosted
Summing matrices Michael Horvath202July 03, 2014 06:16PM
Re: Summing matrices Tim Gould90July 04, 2014 02:18AM
Re: Summing matrices Michael Horvath90July 04, 2014 01:46PM
Re: Summing matrices Tim Gould113July 05, 2014 05:36PM
Re: Summing matrices Travis Cobbs107July 05, 2014 11:21PM
Re: Summing matrices Philippe Hurbain105July 06, 2014 07:39AM
Re: Summing matrices Tim Gould94July 06, 2014 05:38PM
Re: Summing matrices Michael Horvath76July 08, 2014 08:24AM
Re: Summing matrices Travis Cobbs110July 08, 2014 10:04AM



Sorry, only registered users may post in this forum.

Click here to login