Converting to a New Coordinate System

10 views (last 30 days)
Hollis Williams
Hollis Williams on 18 May 2019
Edited: Hollis Williams on 19 May 2019
I have a column vector and am trying to convert it into a new coordinate system. The way I would like to do this is to start with a column vector of size 1x300, corresponding to 100 1x3 vectors all in one column. I then have 3 matrices A, B and C which are all of size 3x100 each corresponding to 100 vectors in an array. I need to take the first vector from the column and multiply the transpose with the the first vector from the array A to get a scalar which is the first entry in a new column vector, then multiply it with the first vector from B for the second entry and multiply it with the first vector from C for the third entry.
I would then repeat this with all the vectors to get a new 1x300 column vector (this corresponds to converting to a new coordinate system I have created). Let me know if that doesn't make sense or if further explanation is required.
Basically, there are 100 1x3 vectors on top of each other in a column corresponding to 100 nodes, then the the 3 arrays correspond to the normal vectors and two tangent vectors at the 100 nodes, so I am taking each node and multiplying it with the normal at that node (ie. first vector from array A), then the two tangents at that node (ie. first vectors from arrays B and C) to get the vector in the new coordinate system, this is then repeated for all the nodes to get a new column vector.
Hollis Williams
Hollis Williams on 19 May 2019
Example: say I have a 3x100 array and I multiply a row vector [0 0 1] into it to get a 1x100 array.
I want to do the same but now I want to multiply the first vector in the 3x100 array with [0 0 1], then the second one with [0 1 0], then the third one with [1 0 0], then go back to [0 0 1] for the fourth vector and carry on cycling through these for the first 75 vectors in the array, then multiply the remaining 25 vectors in the array by [0 0 0]. This way you end up with a 1x100 array as before.
To be more explicit:
[ 0 0 1] * A B ...
C D ...
E F ...
So [0 0 1] multiplies the vector [A C E]^T, then [0 1 0] multiplies the vector [B D F]^T, then
[0 0 1] multiplies the next one and repeat the pattern for the first 75 vectors in the 3x100 array before multiplying the remaining 25 by [0 0 0]. Let me know if this needs clarifiying, this is basically the manipulation which I need to carry out.

Sign in to comment.

Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!