Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Solve Problems P1.1.5 Insight Through Computing: A MATLAB Introduction to Comput

ID: 3742164 • Letter: S

Question

Solve Problems P1.1.5 Insight Through Computing: A MATLAB Introduction to Computational Science and Engineering

P1.1.5 Asolid is a Platonic solid if each face is identical in size and shape. There are only ve:
Solid Faces Face Shape Tetrahedron 4 equilateral triangle Cube 6 square Octahedron 8 equilateral triangle Dodecahedron 12 regular pentagon Icosahedron 20 equilateral triangle
KeyattributesofagivenPlatonicsolidP includeitsedgelengthE,inradiusr,outradiusR,surface area S, and volume V. The inradius of P is the distance from its center to the centroid of any face. It is the radius of the largest sphere that ts inside P. The outradius of P is the distance from its center to any vertex. It is the radius of the smallest sphere that encloses P. Here is a table that species, for each Platonic solid, the values of r, R, S, and V as a function of E:
Solid r R S V
Tetrahedron
6 12 E
6 4 E 3E2 2 12 E3
Cube 1 2E
3 2 E 6E2 E3
Octahedron
6 6 E
2 2 E 23E2 2 3 E3
Dodecahedron 250+1105 20 E
15+3 4 E 325+105E2 15+75 4 E3
Icosahedron 42+185 12 E 10+25 4 E 53E2 15+55 12 E3
Using the entries in this table, it is possible to solve various Platonic solid problems. For example, here is a fragment that assigns to Vol20 the volume of the largest icosahedron that ts inside the unit sphere:
E = 1/(sqrt(10 + 2*sqrt(5))/4); Vol20 = ((15 + 5*sqrt(5))/4)*Eˆ3;
Dene T, C, O, D, and I as follows:
T: the largest tetrahedron that ts inside the unit sphere C: the largest cube that ts inside T O: the largest octahedron that ts inside C D: the largest dodecahedron that ts inside O I: the largest iscosahedron that ts inside D.
Write a script that prints a table showing the inradius, outradius, and edge length of these (nested) Platonicsolids. Thetableshouldhaveaheading,andnumericalvaluesshouldbedisplayedthrough the fteenth decimal place.

Explanation / Answer

Ans:

function [V,F]=platonic_solid(n,r)

phi=(1+sqrt(5))/2;

switch n

case 1

V1=[-0.5;0.5;0;0;];

V2=[-sqrt(3)/6; -sqrt(3)/6; sqrt(3)/3; 0];

V3=[-0.25.*sqrt(2/3); -0.25.*sqrt(2/3); -0.25.*sqrt(2/3); 0.75.*sqrt(2/3)];

F= [1 2 3; 1 2 4; 2 3 4; 1 3 4;];

case 2

V1=[-1; 1; 1; -1; -1; 1; 1; -1;];

V2=[-1; -1; 1; 1; -1; -1; 1; 1;];

V3=[-1; -1;-1; -1; 1; 1; 1; 1;];

F= [1 2 3 4; 1 2 6 5; 2 3 7 6; 3 4 8 7; 4 1 5 8; 5 6 7 8;];

case 3

V1=[-1; 1; 1; -1; 0; 0;];

V2=[-1; -1; 1; 1; 0; 0;];

V3=[ 0; 0; 0; 0; -1; 1;];

F= [1 2 5; 2 3 5; 3 4 5; 4 1 5; 1 2 6; 2 3 6; 3 4 6; 4 1 6;];

case 4

V1=[0;0;0;0;-1;-1;1;1;-phi;phi;phi;-phi;];

V2=[-1;-1;1;1;-phi;phi;phi;-phi;0;0;0;0;];

V3=[-phi;phi;phi;-phi;0;0;0;0;-1;-1;1;1;];

F= [1 4 9;1 5 9;1 8 5;1 8 10;1 10 4; 12 2 5; 12 2 3; 12 3 6; 12 6 9; 12 9 5; 11 7 10; 11 10 8; 11 8 2; 11 2 3; 11 3 7; 2 5 8; 10 4 7; 3 6 7; 6 7 4; 6 4 9; ];

case 5

V1=[1;(1/phi);-phi;phi;-1;0;-phi;1;-1;-1;1;(1/phi);-1;0;0;-(1/phi);phi;-(1/phi);1;0;];

V2=[1;0;-(1/phi);(1/phi);1;-phi;(1/phi);-1;1;-1;-1;0;-1;-phi;phi;0;-(1/phi);0;1;phi;];

V3=[[1;phi;0;0;-1;-(1/phi);0;1;1;1;-1;-phi;-1;(1/phi);-(1/phi);phi;0;-phi;-1;(1/phi);]];

F=[1,2,16,9,20;2,16,10,14,8;16,9,7,3,10;7 9 20 15 5;5,7,3,13,18;3,13,6,14,10;6,13,18,12,11;6,11,17,8,14;11,12,19,4,17;1,2,8,17,4;1,4,19,15,20;12,18,5,15,19];

otherwise

warning('False input for n')

end

[THETA,PHI,R]=cart2sph(V1,V2,V3);

R=r.*ones(size(V1(:,1)));

[V1,V2,V3]=sph2cart(THETA,PHI,R);

V=[V1 V2 V3];

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote