Plot points on a tetrahedron

2 views (last 30 days)
Su_pat
Su_pat on 17 Apr 2020
Answered: Devineni Aslesha on 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?

Accepted Answer

Devineni Aslesha
Devineni Aslesha on 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.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!