I didn't know how to find r
13 views (last 30 days)
Show older comments
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 Comments
Answers (3)
Star Strider
on 14 Oct 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 Comments
DGM
on 7 Nov 2023
Edited: DGM
on 7 Nov 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 Comments
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!