Effacer les filtres
Effacer les filtres

Plot points on a tetrahedron

7 vues (au cours des 30 derniers jours)
Su_pat
Su_pat le 17 Avr 2020
Hello,
I need to plot a bunch of points on a tetrahedron. I am getting stuck when I use the mesh function for the tetrahedron. I need to be able to plot a tetrahedron and then plot other points on a tetrahedron.
These are the 4 corners of the tetrahedron that I need to plot -
(1/2, 1/sqrt(2), 0), (-1/2, 0, 1/sqrt(2)), (-1/2, 0, -1/sqrt(2)), (1/2, -1/sqrt(2), 0)
How do I go on about this?

Réponse acceptée

Devineni Aslesha
Devineni Aslesha le 21 Avr 2020
Hi Sunayana,
To plot a tetrahedron with the four vertices, use the below code.
FV.Vertices = [1/2 1/sqrt(2) 0; -1/2 0 1/sqrt(2); -1/2 0 -1/sqrt(2); 1/2 -1/sqrt(2) 0];
FV.Faces = nchoosek([1 2 3 4],3);
FV.FaceVertexCData = rand(4,3);
FV.FaceColor = 'interp';
patch(FV)
view(3)
For more information, refer the following link.

Plus de réponses (0)

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by