Plot points on a tetrahedron

2 次查看(过去 30 天)
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?

采纳的回答

Devineni Aslesha
Devineni Aslesha 2020-4-21
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by