I didn't know how to find r
8 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (3 件)
Star Strider
2021 年 10 月 14 日
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 件のコメント
DGM
2023 年 11 月 7 日
編集済み: DGM
2023 年 11 月 7 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!