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

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

lvl107
18-Opal

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.

47 REPLIES 47
Werner_E
24-Ruby IV
(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/

 

I greatly appreciate your explanation, Werner.Rotation.PNG

Best Regards.

Werner_E
24-Ruby IV
(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

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

cube.PNG

Best Regards.

   Loi.

Werner_E
24-Ruby IV
(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.

 

ttokoro
17-Peridot
(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
17-Peridot
(To:ttokoro)

image.png

ttokoro
17-Peridot
(To:ttokoro)

image.png

Werner_E
24-Ruby IV
(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".

(1).pngRegular Octahedron.png

(I).png(II).png

(III).png(IV).png

A.pngB.png

A.pngB.png

D.pngD^T.png

Truncated Octahedron-.pngTruncated Octahedron--.png

O1.pngO2.png

Icosidodecahedron_1.pngIcosidodecahedron_2.png

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

1.pngIcosidodecahedron.png

T.png

Truncated Icosahedron.png

I.pngIcosidodecahedron( ' ).png

I.pngRhombicosidodecahedron.png

Octahedron.pngOctahedron_.png

ttokoro
17-Peridot
(To:lvl107)

image.png

I.pngII.pngIII.pngIV.png

 

I.pngII.pngIII.png

I.pngII.pngIII.png

I.pngII.pngIII.png

Cuboid.png

Cuboid Truncated.pngE.pngImage.png

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."