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

18-Opal

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

Hello Everyone.
From :

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 ?
Regards.

47 REPLIES 47
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

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/

18-Opal
(To:Werner_E)

I greatly appreciate your explanation, Werner.

Best Regards.

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.

18-Opal
(To:Werner_E)

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

Best Regards.

Loi.

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.

17-Peridot
(To:lvl107)

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.

17-Peridot
(To:ttokoro)

17-Peridot
(To:ttokoro)

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

18-Opal
(To:ttokoro)

18-Opal
(To:ttokoro)

18-Opal
(To:ttokoro)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

18-Opal
(To:lvl107)

17-Peridot
(To:lvl107)

18-Opal
(To:ttokoro)

18-Opal
(To:ttokoro)

18-Opal
(To:ttokoro)

18-Opal
(To:ttokoro)

18-Opal
(To:ttokoro)

Announcements
Check out the latest