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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to plot a point in 3-D and Rotation of the point ?

lvl107
20-Turquoise

How to plot a point in 3-D and Rotation of the point ?

Hello Everyone.
From :


       Point.PNG

To : 1. How to plot a point in 3-D and :

       2. Rotation of that point a angle t (say, = Pi/2) about X-axis ?
Thanks in advance for your time and help.
Regards.

123 REPLIES 123
Werner_E
25-Diamond I
(To:lvl107)

1) Plotting points requires a 3x1 matrix and the three elements of that matrix are vectors, too, representing the x-, y- and z-coordinates of the points you'd like to plot. Mathcad accepts row AND column vectors in that 3x1 matrix. If you just want to plot one single point, your 3x1 matrix would consist of three 1x1 matrices!

Furthermore you have to change the plot type from surface plot to "Data Points/Scatter Plot". In case you still get an error (an old bug), change the plot style to vector plot and then back to scatter plot.

You may also demand to have the points connected with lines, but you must keep in mind, that they are just connected in the order they are defined! See the pic

Werner_E_0-1605818330011.png

 

2) Use the usual rotation matrices. See for example here: https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations

It sure would help to write some utility functions to convert a normal 3x1 point vector to the data structure needed for the 3D-plot and maybe also the other way round.

 

To rotate around an arbitrary axis is far more complicated and is best done using homogenous coordinates (quaternions) - see here for example: http://paulbourke.net/geometry/rotate/

 

lvl107
20-Turquoise
(To:Werner_E)

I greatly appreciate your explanation, Werner.Rotation.PNG

Best Regards.

Werner_E
25-Diamond I
(To:lvl107)

The attached sheet should help with converting vectors to data structure for plotting in 3D and vice versa and also with rotating a point around the x-axis.

Rotate-x.gif

lvl107
20-Turquoise
(To:Werner_E)

Many, many thanks again, Werner. Still have a very small query : How to correct it for cube ?

cube.PNG

Best Regards.

   Loi.

Werner_E
25-Diamond I
(To:lvl107)

The cube you defined is NOT just a number of points but a number of surface patches (quadrilateral).

You would have to write a function which extracts every point, rotates it and saves the result back to the very same position it came from - that means you have to preserve the data structure of the surface.

So you can't use vec2plot on this structure as the structure gets lost that way and can't be reconstructed.

 

JKT
13-Aquamarine
13-Aquamarine
(To:Werner_E)

I have a little helper function for that process: fInsOut.

JKT_0-1705583934534.png

That transforms the matrix to a single matrix consisting of xyz vectors. Then just loop through the rows and columns in the new matrix and do the transformation to each. After that run the above function again to get back to the original format. Adding the time dependence to that will complicate matters ... a lot.

ttokoro
20-Turquoise
(To:lvl107)

image.pngimage.pngimage.pngimage.png

With Prime 6 I can't use 3rd rotation angle. So set it to 0 for DataSPH.  (45 degree rotation only)

Thereafter change the XYZ data to XZY and use second DataSPH. (210 degree rotation)

Then convert the data to original XYZ.  

ttokoro
20-Turquoise
(To:ttokoro)

image.png

ttokoro
20-Turquoise
(To:ttokoro)

image.png

Werner_E
25-Diamond I
(To:ttokoro)

@ttokoro 

It is unclear to me to what extent you think that these little pictures you keep posting would be helpful or useful to the questioner? I may be blind, but I see no attempt to answer the questioner's questions ...
Perhaps you could explain the intent behind your posts in more detail as I don't want to assume that it's all about teasing or "showing off".

lvl107
20-Turquoise
(To:ttokoro)

(1).pngRegular Octahedron.png

lvl107
20-Turquoise
(To:ttokoro)

(I).png(II).png

lvl107
20-Turquoise
(To:ttokoro)

(III).png(IV).png

lvl107
20-Turquoise
(To:lvl107)

A.pngB.png

lvl107
20-Turquoise
(To:lvl107)

A.pngB.png

D.pngD^T.png

lvl107
20-Turquoise
(To:lvl107)

Truncated Octahedron-.pngTruncated Octahedron--.png

lvl107
20-Turquoise
(To:lvl107)

O1.pngO2.png

lvl107
20-Turquoise
(To:lvl107)

Icosidodecahedron_1.pngIcosidodecahedron_2.png

lvl107
20-Turquoise
(To:lvl107)

Truncated Cuboctahedron_1.pngTruncated Cuboctahedron_2.pngTruncated Cuboctahedron_3.pngTruncated Cuboctahedron_4.png

lvl107
20-Turquoise
(To:lvl107)

1.pngIcosidodecahedron.png

lvl107
20-Turquoise
(To:lvl107)

T.png

Truncated Icosahedron.png

lvl107
20-Turquoise
(To:lvl107)

I.pngIcosidodecahedron( ' ).png

lvl107
20-Turquoise
(To:lvl107)

I.pngRhombicosidodecahedron.png

lvl107
20-Turquoise
(To:lvl107)

Octahedron.pngOctahedron_.png

ttokoro
20-Turquoise
(To:lvl107)

image.png

lvl107
20-Turquoise
(To:ttokoro)

I.pngII.pngIII.pngIV.png

 

lvl107
20-Turquoise
(To:ttokoro)

I.pngII.pngIII.png

lvl107
20-Turquoise
(To:ttokoro)

I.pngII.pngIII.png

lvl107
20-Turquoise
(To:ttokoro)

I.pngII.pngIII.png

Cuboid.png

Announcements

Top Tags