Filter löschen
Filter löschen

Plot points on a tetrahedron

7 Ansichten (letzte 30 Tage)
Su_pat
Su_pat am 17 Apr. 2020
Beantwortet: Devineni Aslesha am 21 Apr. 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?

Akzeptierte Antwort

Devineni Aslesha
Devineni Aslesha am 21 Apr. 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.

Weitere Antworten (0)

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by