Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: Transformation matrix

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
09:12 AM

09-23-2020
09:12 AM

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

Labels:

21 REPLIES 21

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
09:56 AM

09-23-2020
09:56 AM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:05 AM

09-23-2020
10:05 AM

Re: Transformation matrix

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 !😃

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
11:00 AM

09-23-2020
11:00 AM

Re: Transformation matrix

@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 😉

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:00 AM

09-23-2020
10:00 AM

Re: Transformation matrix

Like this?

Success!

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:48 AM

09-23-2020
10:48 AM

Re: Transformation matrix

Incidentally...

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

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
11:14 AM

09-23-2020
11:14 AM

Re: Transformation matrix

it is complicated because there is no real standard about this.

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)

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
05:23 AM

09-24-2020
05:23 AM

Re: Transformation matrix

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 .

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
07:45 AM

09-24-2020
07:45 AM

Re: Transformation matrix

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 ?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
08:00 AM

09-24-2020
08:00 AM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
08:20 AM

09-24-2020
08:20 AM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
09:11 AM

09-24-2020
09:11 AM

Re: Transformation matrix

I don't find my mistake😥😓

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
09:24 AM

09-24-2020
09:24 AM

Re: Transformation matrix

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.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
09:43 AM

09-24-2020
09:43 AM

Re: Transformation matrix

wooww😲

great , i try to understand that !🤗

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
10:05 AM

09-24-2020
10:05 AM

Re: Transformation matrix

sorry I do not yet understand what you are doing

please see attached file

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
10:23 AM

09-24-2020
10:23 AM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
10:47 AM

09-24-2020
10:47 AM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
11:16 AM

09-24-2020
11:16 AM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
11:20 AM

09-24-2020
11:20 AM

Re: Transformation matrix

huge typo 😖I put 1 in place of i

now i can continue to check my value

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
12:07 PM

09-24-2020
12:07 PM

Re: Transformation matrix

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-24-2020
05:32 PM

09-24-2020
05:32 PM

Re: Transformation matrix

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

You can multiply the values by 180/pi

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-28-2020
03:09 AM

09-28-2020
03:09 AM

Re: Transformation matrix

And finally :

Great!

Special thanks for Werner , he showed me the way.

👍