Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi Everyone,
From the following :
How to Rotate a quadrilateral and Plot its image on the Graph ?
Thanks in advance.
Best Regards.
Solved! Go to Solution.
3D data format for MC15 and Prime is changed. Prime 8 sheet attached.
A rotation around the z-axis can be accomplished by a multiplication with
For example
See also
https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations
or maybe (?)
https://zh.wikipedia.org/wiki/%E6%97%8B%E8%BD%AC%E7%9F%A9%E9%98%B5#%E6%97%8B%E8%BD%AC
Hi,
Rotations in 3D can also be carried out using Quaternions.
An excellent worksheet was posted on this forum that details Quaternions, and I include it here.
How to use the functions in the worksheet to do the rotation of the quadrilateral is also included.
I also have Prime 8 versions of the sheets if anyone wants them.
Cheers
Terry
I greately appreciate your time and help with your *.xmcd attacted. I don't the reason for as the following:
"This variable is undefined" was shown.
Thanks again.
Loi.
Hi,
File location for the referenced sheet at the top of the page must be adjusted to suit your system where the file is located.
Right click on the little arrow and you get this pop up menu and select properties
This pops up a tabbed dialog box go to Reference Tab
Here you can browse button to the location of the file "220828-Quaternions.xmcd" on your system and OK.
Cheers
Terry
Thank all of you, Werner, Terry, and Tokoro. 😊😊😊. @ttokoro Brief of explanation, say : Screen-shot of program functions... please. Query still exists, say : how to mirror a quadrilateral about the plane of X-axis_Y-axis ? (Screen-shot of program functions... please.)
Best, Best Regards.
Loi.
how to mirror a quadrilateral about the plane of X-axis_Y-axis ?
To mirror points at the xy-plane you simply change the sign of the z-coordinate for each point!
Hi,
To mirror in the XY plane just negate the z coordinate of each point.
If positive z turn to negative
If negative z turn to positive
So simply multiply z by -1. This also covers z = 0.
Cheers
Terry
Tokoro, the reason I need help with the screen-shot of program function is : all of us don't have to re-calculate the coordinate of the points for related query :
How to fill color the Octagon ? (make the "lid" for Pyramid) (see the Graph)
Thanks in advance.
Best, Best Regards.
Loi
3D data format for MC15 and Prime is changed. Prime 8 sheet attached.
Would this help?
Have fun with these, too 😉
For more information about the built-in polyhedra and the Wythoff notation, look up "Graphing uniform polyhedra" in the Mathcad help and open the appropriate Quick sheet it links to.
Many thanks for your time and help again, Werner. I guess my question is not clear. I mean my question would be : "How to Fill Surface to Octagon so to fill different color say red color different from blue color":
Best Regards.
Loi.
In other words: "How to Fill Surface that Octagon ?"
Thanks again, A clear and neat answer, Werner. My small query still exist: Is there a way to Fill Surface A Non-Regular-Octagon ?
Best Regards.
Loi.
: Is there a way to Fill Surface A Non-Regular-Octagon ?
Its easy if the polygon is convex. Simply chose any point inside the polygon (you may use the center of any chord for instance) and use it the same way like I used the center of the polygon (0/0/height) in my example above when I created the structure Okta[0. Basically using the tringles formed by two adjacent polygon vertices and the center point as a 2x2 patch for the structure Mathacds 3D plot expects (doubling the center point).
Of course it is your responsibility to make sure that all polygon vertices are in the same plane!
If you look at the structure
you see the the three matrices consists of the x-, y- and z-coordinates of the points which form the surface grid.
The second row in each of the three matrices are the coordinates of the polgon vertices (the last one is repeated at the end to close the polygon) and the first row consists of the coordinate(s) of the center point - in the example shown its (0/0/6).
The next picture shows the same structure but a different point inside the polygon -> (4/-2/6). As long as you don't draw lines and points you won't notice the difference:
You may even use one of the vertices of the polygon as "inside" point, here (12/0/6)
If you do so, you may also delete the first and last column in each of the three matrices.
Bu if the polygon is not convex you are out of luck with this simple method as this may take quite some additional efforts (probably not worth the time), I suspect.