spheresegmentvolume

バージョン 1.1.0.0 (2.74 KB) 作成者: John D'Errico
Volume of a (hyper)sphere, sphere cap, or any band through a sphere defined by two parallel planes
ダウンロード: 2.6K
更新 2010/9/1

ライセンスの表示

This tool computes the volume inside a sphere in n dimensions, or inside a sphere cap, or inside any part of a sphere that can be defined by two parallel slicing planes.

Compute the volume of a unit, complete sphere.
In 2-d, the "volume" is pi.

V = spheresegmentvolume([],2)
V =
3.1416

V - pi
ans =
0

In 3-d, compute the volume of an exact unit hemisphere. The volume is pi*2/3, approximately 2.0944

V = spheresegmentvolume([0,1],3)
V =
2.0944

V - 2*pi/3
ans =
-4.4409e-16

In 4-d, compute the volume inside a central band around a hyper-sphere of radius 2, with the band running from -1 to +1. Thus, the parallel planes are separated by 2 units of distance and are symmetric around the center of the sphere.

V = spheresegmentvolume([-1,1],4,2)
V =
58.967

In 50 dimensions, compute the volume inside a unit hemi-spherical cap.

V = spheresegmentvolume([0,1],50)
V =
8.6511e-14

引用

John D'Errico (2024). spheresegmentvolume (https://www.mathworks.com/matlabcentral/fileexchange/18641-spheresegmentvolume), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersVolume Visualization についてさらに検索
タグ タグを追加

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

Repair made for odd dimensionality