Plot points on a tetrahedron

2 visualizaciones (últimos 30 días)
Su_pat
Su_pat el 17 de Abr. de 2020
Respondida: Devineni Aslesha el 21 de Abr. de 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?

Respuesta aceptada

Devineni Aslesha
Devineni Aslesha el 21 de Abr. de 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.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by