I didn't know how to find r
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
A cube has a side of 18cm.
(a) Determine the radius of a sphere that has the same surface area
as the cube.
a=6*18*18
a= @(r ) (4*pi*r.^2)
(b) Determine the radius of a sphere that has the same volume as the cube.
0 comentarios
Respuestas (3)
Jan
el 14 de Oct. de 2021
a = 6 * 18 * 18
a = 4 * pi * r.^2
r = sqrt(6 * 18 * 18 / (4 * pi))
0 comentarios
Star Strider
el 14 de Oct. de 2021
A different approach —
ac = 6*18*18
as = @(r) (4*pi*r.^2)
r = fzero(@(r) ac - as(r), -1)
Check_Equal_Areas = ac - as(r)
This solves for the ‘r’ value that makes the sphere area equal to the cube area. See the codumentation for the function to understand how it works.
.
0 comentarios
DGM
el 7 de Nov. de 2023
Editada: DGM
el 7 de Nov. de 2023
Walter hinted at a symbolic approach to a tangential junk question-as-comment. I figured I'd provide an answer covering both before cleaning up.
% we have a cube and want to find the equivalent sphere
L0 = 15; % cube side length
syms R L positive real
Aexpr = 6*L^2 == 4*pi*R^2;
Vexpr = L^3 == 4/3*pi*R^3;
% radius for area equality
RA = solve(Aexpr,R) % symbolic solution
RAnumeric = vpa(subs(RA,L,L0),6) % evaluate
% radius for volume equality
RV = solve(Vexpr,R) % symbolic solution
RVnumeric = vpa(subs(RV,L,L0),6) % evaluate
Maybe we want the opposite:
% we have a sphere and want to find the equivalent cube
R0 = 15; % sphere radius
syms R L positive real
Aexpr = 6*L^2 == 4*pi*R^2;
Vexpr = L^3 == 4/3*pi*R^3;
% side length for area equality
LA = solve(Aexpr,L) % symbolic solution
LAnumeric = vpa(subs(LA,R,R0),6) % evaluate
% side length for volume equality
RV = solve(Vexpr,L) % symbolic solution
LVnumeric = vpa(subs(RV,R,R0),6) % evaluate
0 comentarios
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!