Skip to main content
20-Turquoise
November 19, 2020
Question

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

  • November 19, 2020
  • 2 replies
  • 148923 views

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.

2 replies

25-Diamond I
November 19, 2020

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/

 

lvl10720-TurquoiseAuthor
20-Turquoise
November 20, 2020

I greatly appreciate your explanation, Werner.Rotation.PNG

Best Regards.

25-Diamond I
November 20, 2020

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

21-Topaz I
November 19, 2020

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.  

21-Topaz I
November 20, 2020

image.png

21-Topaz I
November 20, 2020

image.png

lvl10720-TurquoiseAuthor
20-Turquoise
October 12, 2024
23-Emerald V
November 3, 2025

Hi, Loi

 

Out of curiosity, could you produce a video of one of these cuboids rotating and passing through a hole in the other one?

 

I did have a worksheet that did that, but I've got no idea where it is now.

 

2021 12 30 a.png

 

I think the following worksheet produced the cuboids, but I can't confirm that as I've only got Mathcad Express (which lacks programming as well as 3DPlot component that handles nested meshes).

 

Stuart

 

 

lvl10720-TurquoiseAuthor
20-Turquoise
December 5, 2025

00-1.png

 

00-2.png

 

(view in My Videos)

23-Emerald V
November 2, 2025

Nice.  It's a shame one can't create such lots as readily in Mathcad Prime.

 

https://community.ptc.com/t5/Mathcad/Why-rotatemesh-is-in-red/m-p/766304/highlight/true#M199023

 

Stuart

lvl10720-TurquoiseAuthor
20-Turquoise
November 4, 2025

Hi, Stuart.

 

1.png2.png3.png

 

(view in My Videos)

 

Regards.

Loi.

lvl10720-TurquoiseAuthor
20-Turquoise
January 18, 2026

0.png1.png2.png

 

(view in My Videos)

(view in My Videos)

lvl10720-TurquoiseAuthor
20-Turquoise
February 3, 2026

0.png1.png

 

(view in My Videos)