cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - You can change your system assigned username to something more personal in your community settings. X

13-Aquamarine

## Transformation matrix

Hello

i make a worksheet for calculate transformation matrix:

first i write Rx Ry Rz rotation matrix

in second time (it's not mandatory), i define passage order of passage. by habit i use Cardan (or reverse RTL)

after i have the matrix position : X Y Z RX RY RZ

(in this matrix i have 1 line or over 1000 lines)

I define a transformation function, in this i use an homogeneous matrix

in this matrix, the first 3x3 are the rotation matrix (matrix of cosine) and the last matrix 3x1 are the position matrix

Now , my problem:

I want to calculate all transformation matrix (with T function) for all Position matrix

exemple:

T(0,-2,0,-1,-5,0.5)

T(1,0,5,0,-1,1)

and other ...

and finally i want 1 matrix with all submatrix

21 REPLIES 21
24-Ruby V
(To:XDN)

1) By default vectors and matrices start numbering their elements with 0, not with 1 as you thought. So your function T() won't work for a single set of six values (you should always test your function!).
Fortunately there is a system variable ORIGIN and if you set it to 1 by typing ORIGIN:=1 at the top of the sheet, or use a global assignment anywhere on the sheet or set the variable via the menu ("Calculation" ribbon) then your sheet works OK.

2) Here is one possible way to achieve what you demanded:

P6 worksheet attached

13-Aquamarine
(To:Werner_E)

Ok for your first note , i use origin =1 in ribbon

and i erase first line in position matrix (i write the first line in this matrix just for understanding)

i watch the rest !😃

24-Ruby V
(To:XDN)

@XDN wrote:

Ok for your first note , i use origin =1 in ribbon

Fine, its up to you how you handle this.

and i erase first line in position matrix (i write the first line in this matrix just for understanding)

i watch the rest !😃

Not necessary to delete the line with the columns headers. But if you do you would have to change my "O+1" for just "O" and my "i-1" for "i" in the calculation of All_Ts.

Keep on watching 😉

23-Emerald III
(To:XDN)

Like this?

Success!
Luc

23-Emerald III
(To:XDN)

Incidentally...

Are you sure that the Euler transformation does not use Ry ?

Luc

13-Aquamarine
(To:LucMeekes)

Eleur don't use Ry because use 2 . Rz with another angle parameter

some people calling all order passage 'Euler angle'  even for Cardan, RTL (roll,pitch,yaw)

another solution!  use quaternion 😅 but i don't know this 😉

it's good for me with Werner's solution (your solution is more compact, but I understand Werner's writing better)

13-Aquamarine
(To:XDN)

first of all a big thank you for your precious advice which helps me to learn Mathcad. It's not easy forme, but i try and i hold on. And excuse me for my approximate language.

Now i update my worksheet, but I'm breaking my head over how to write. I know that i want ... but i can't write it.

Please see the attached file, i can to explain it .

13-Aquamarine
(To:XDN)

i try it

But it's wrong, because the i parameter for Bi point is not the same for traj

is it possible to introduce another parameter in for loop ?

13-Aquamarine
(To:XDN)

I think I am getting closer, but I cannot write the calculation for each iteration of the transformation matrix

13-Aquamarine
(To:XDN)

Ok, I'm getting closer, but I can't seem to display all the sub matrices. Only the last result appears

13-Aquamarine
(To:XDN)

I don't find my mistake😥😓

I can't display all the sub matrices for j parameter

24-Ruby V
(To:XDN)

You have to nest the loops. The i-loop has to do its work inside of the j-loop, because you want its calculaton done for every element in traj and not just for the last one.

Furthermore its not necessary to keep all matrices "Result" (called them "Res" now) , so I overwrite "Res" in every run of the outer j-loop.

13-Aquamarine
(To:Werner_E)

wooww😲

great , i try to understand that !🤗

13-Aquamarine
(To:XDN)

sorry I do not yet understand what you are doing

13-Aquamarine
(To:XDN)

obviously is necessary to kill the last line in all submatrix in Bi_dep because this  comes from homogeneous transformation

13-Aquamarine
(To:XDN)

I try it , but the value are wrong

if i control the result for the yellow line with the green parameter

the correct values are in blue

13-Aquamarine
(To:XDN)

I did a new check, my program is wrong, it's clear

if i calculate manualy, the green value are right, if i calculate with my program, the value are wrong

13-Aquamarine
(To:XDN)

huge typo 😖I put 1 in place of i

now i can continue to check my value

13-Aquamarine
(To:XDN)

and finally (until the next time😅)

now i have my final matrix, where "course V1" and next are the stroke cylinder, and L1 and next are the 3D lenght betwen 2 points in 3D

now i want to extract the extremum

for example :

i search the max and min length for all length between 2 points

i search the max and min stroke for all cylinder

and when i find it, i want the extract position where i find it.

and is it possible to display the angle value Rx Ry Rx in degree ?

and for the fun, it is possible to make a draw

on the Y-axis the cylinder lenght

on the X- axis the number of 3D point

i have 6 cylinder, so i have 1 curve for each cylinder

24-Ruby V
(To:XDN)

> and is it possible to display the angle value Rx Ry Rx in degree ?

You can multiply the values by 180/pi

13-Aquamarine
(To:Werner_E)

And finally :

Great!

Special thanks for Werner , he showed me the way.

👍

Announcements
Top Tags