Sphere
詳細とオプション
- Sphereは,幾何学領域として,またグラフィックスプリミティブとして使うことができる.
- Sphere[]はSphere[{0,0,0}]に等しい. »
- Sphere[n]は,正の整数 n については,
の単位球,Sphere[{0,…,0}]に等しい. - Sphereは外郭構造
を表す. - Sphereは,GraphicsおよびGraphics3Dで使うことができる.
- グラフィックスでは,点 p, piおよび半径 r は,Scaled式およびDynamic式でよい.
- グラフィックスの描画は,FaceForm,Specularity,Opacity,色の各指示子の影響を受ける.
- Sphere[{p1,p2,…},{r1,r2,…}]は,中心 pi,半径 riの球の集合を表す.
予備知識
- Sphereは,
次元空間にある球面を表すグラフィックスおよび幾何のプリミティブである.Sphere[p,r]は,
における,中心 p,半径 r の球面
を表す.r は任意の非負の実数でよく,p は任意の正の長さ
でよい.略記形式のSphere[p]はSphere[p,1]に,Sphere[n]はSphere[ConstantArray[0, n],1]に等しく,Sphere[]は自動評価されてSphere[{0,0,0}]となる. - 半径
が等しい球面オブジェクトの集合(複数の球面)は,Sphere[{p1,…,pk},r]によって効率的に表すことができ,半径が異なる球はSphere[{p1,…,pk},{r1,…,rk}]によって表すことができる. - Sphereオブジェクトは,GraphicsおよびGraphics3Dを使って,それぞれ二次元および三次元で視覚的にフォーマットすることができる.グラフィックス内のSphereオブジェクトの外観は,面指示子FaceForm(三次元),Redのような色指示子,不透明度/透明度の指示子のOpacity/Specularity,スタイルオプションのAntialiasingを使って変更することができる.
- Sphereは,計算を行うべき領域指定にも使うことができる.例えば,Integrate[1,{x,y,z}∈Sphere[{0,0,0},r]]とArea[Sphere[{0,0,0},r]]はどちらも半径
の球の表面積
を返す. - Sphereは数多くの他のシンボルと関連がある.Sphereは,RegionBoundary[Ball[{x,y,z},r]]を使って計算できるように,球体の境界を表す.楕円体の表面積(Ellipsoidで表される立体としての楕円体と混同してはならない)は,Scaledを使ってSphereから求めることができる.与えられた点集合を通る球面はCircumsphereを使って得ることができる.Sphereオブジェクトは,ImplicitRegion[(x-u)2+(y-v)2+(z-w)2r2,{u,v,w}]または ParametricRegion[{x,y,z}+r{Cos[θ]Sin[ϕ],Sin[θ]Sin[ϕ],Cos[ϕ]},{{θ,0,2π},{ϕ,0,π}}]として表すことができる.SurfaceData["Sphere",property]あるいはEntity["Surface","Sphere"][property]を使って標準位置にある球面の計算済みの特性を得ることができる.
例題
すべて開く すべて閉じる例 (2)
スコープ (22)
グラフィックス (12)
指定 (4)
Graphics3D[Sphere[{1, 1, 1}]]Graphics3D[{Sphere[{0, 0, 0}, 1], Sphere[{3, 3, 0}, 2]}]Graphics3D[Sphere[], Axes -> True]s = {0, 0, 0};Graphics3D[Sphere[{s, s + 2}]]スタイリング (4)
Table[Graphics3D[{c, Sphere[]}], {c, {Red, Green, Blue, Yellow}}]FaceFormを使って表面と裏面に異なる特性を指定することができる:
Graphics3D[{FaceForm[Yellow, Blue], Sphere[]}, PlotRange -> {{-1, 1}, {-.8, 1}, {-1, 1}}]Table[Graphics3D[{Orange, Specularity[White, n], Sphere[]}], {n, {5, 20, 100}}]Graphics3D[{Glow[Red], Black, Sphere[]}]Opacityは表面の不透明度を指定する:
Table[Graphics3D[{Opacity[o], Sphere[]}], {o, {0.3, 0.5, 0.9}}]座標 (4)
Scaled座標を使う:
Graphics3D[{Sphere[Scaled[{.5, .8, .5}], 1]}, PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]Scaled半径を使う:
Graphics3D[Sphere[{0, 0, 0}, Scaled[0.25]], Axes -> True, PlotRange -> 1]Graphics3D[Sphere[Scaled[{0, 0, 0.5}, {2, 2, 2}], 2], PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]点はDynamicでもよい:
DynamicModule[{x}, {Slider[Dynamic[x], {-0.5, 0.5}], Graphics3D[{Sphere[], Sphere[Dynamic[{x, 1, 1}], 1 / 4]}]}]領域 (10)
RegionEmbeddingDimension[Sphere[{Subscript[c, 1], Subscript[c, 2], Subscript[c, 3]}, r]]RegionDimension[Sphere[{Subscript[c, 1], Subscript[c, 2], Subscript[c, 3]}, r]]ℛ = Sphere[{0, 0, 0}, 1];{RegionMember[ℛ, {1, 0, 0}], RegionMember[ℛ, {0, 0, 0}], RegionMember[ℛ, {1, 1, 1}]}RegionMember[Sphere[{Subscript[c, 1], Subscript[c, 2], Subscript[c, 3]}, r], {x, y, z}]ℛ = Sphere[{0, 0, 0}, 1];{Area[ℛ], RegionMeasure[ℛ]}c = RegionCentroid[ℛ]Graphics3D[{{Opacity[0.5], LightBlue, ℛ}, {PointSize[Large], Red, Point[c]}}]ℛ = Sphere[{0, 0, 0}, 1];{RegionDistance[ℛ, {1, 0, 0}], RegionDistance[ℛ, {0, 0, 0}], RegionDistance[ℛ, {1, 1, 1}]}ContourPlot3D[Evaluate@RegionDistance[ℛ, {x, y, z}], {x, -2, 2}, {y, 0, 2}, {z, -2, 2}, Mesh -> None, Contours -> {0.25, 0.5, 1}, BoxRatios -> Automatic]ℛ = Sphere[{0, 0, 0}, 1];{SignedRegionDistance[ℛ, {1, 0, 0}], SignedRegionDistance[ℛ, {1 / 2, 1 / 2, 1 / 2}], SignedRegionDistance[ℛ, {1, 1, 1}]}ℛ = Sphere[{0, 0, 0}, 1];{RegionNearest[ℛ, {1, 0, 0}], RegionNearest[ℛ, {1 / 2, 1 / 2, 1 / 2}]}spherePoints[{n_, m_}, c_, r_] :=
Flatten[Table[c + r{Cos[k 2π / n]Sin[l π / m], Sin[k 2π / n]Sin[l π / m], Cos[l π / m]}, {k, 0., n - 1}, {l, 0., m - 1}], 1];pl = spherePoints[{16, 8}, RegionCentroid[ℛ], 2];
npl = Table[RegionNearest[ℛ, p], {p, pl}];Legended[Graphics3D[{ℛ, {Thin, Gray, Line[Transpose[{pl, npl}]]}, {Red, Point[pl]}, {PointSize[Medium], Blue, Point[npl]}}, Lighting -> "Neutral", Boxed -> False], PointLegend[{Red, Blue}, {"start", "nearest"}]]BoundedRegionQ[Sphere[{Subscript[c, 1], Subscript[c, 2], Subscript[c, 3]}, r]]RegionBounds[Sphere[{0, 0, 0}, r]]ℛ = Sphere[{0, 0, 0}, 1];BoundedRegionQ[ℛ]b = RegionBounds[ℛ]Graphics3D[{{EdgeForm[White], Opacity[0.2, Yellow], Cuboid@@Transpose[b]}, ℛ}, Boxed -> False]ℛ = Sphere[{Subscript[c, 1], Subscript[c, 2], Subscript[c, 3]}, r];Integrate[x y z, {x, y, z}∈ℛ]ℛ = Ball[{1, 2, 3}, 4];MinValue[{x y z - x y, {x, y, z}∈ℛ}, {x, y, z}]//RootReduceℛ = Sphere[{1, 2, 3}, 3];Reduce[x^2 + y^2 + z^2 == 1 && x - y - z == -(1/2) && {x, y, z}∈ℛ, {x, y, z}]アプリケーション (5)
vc = PolyhedronData[#, "Vertices"]& /@ PolyhedronData["Platonic"];Row[Graphics3D[{Specularity[White, 30], Orange, GraphicsComplex[#, Table[Sphere[i], {i, Length[#]}]]}, Boxed -> False]& /@ vc]Graphics3D[{Specularity[White, 30], Table[With[{x = 2Cos[t], y = 2Sin[t], p = 2Sin[t + Pi], q = 2Sin[t + Pi]}, {Hue[t / (5Pi)], Sphere[{x, y, t}, .3], Sphere[{p, q, t}, .3], Cylinder[{{x, y, t}, {p, q, t}}, .1]}], {t, 0, 5Pi, .3}]}, Boxed -> False, Background -> GrayLevel[.2]]Graphics3D[With[{c = ColorData["SouthwestColors"]}, {Opacity[.7], Specularity[White, 20], c[0], Sphere[], Table[{c[i / 7], Sphere[{Cos[2 Pi i / 6], 0, Sin[2Pi i / 6]}, 1]}, {i, 6}]}], Lighting -> "Neutral", Boxed -> False, ViewPoint -> Front]Sphereを使ってGraphPlot3Dのノードを描画する:
GraphPlot3D[Table[i -> Mod[i ^ 2, 50], {i, 0, 50}], SelfLoopStyle -> None, EdgeShapeFunction -> ({Cylinder[#1, 0.1]}&), VertexShapeFunction -> ({Sphere[#, 0.3]}&)]BubbleChart3DでSphereを使う:
BubbleChart3D[RandomInteger[100, {2, 20, 4}]]特性と関係 (8)
Scaleを使って楕円体を得る:
Graphics3D[Scale[Sphere[], {2, 4, 3}, {0, 0, 0}], Axes -> True]Graphics[Circle[]]ContourPlot3Dで生成された球の陰的指定:
ContourPlot3D[x ^ 2 + y ^ 2 + z ^ 2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Mesh -> None]ParametricPlot3Dで生成された球のパラメータ的な指定:
ParametricPlot3D[{Cos[ϕ]Sin[θ], Sin[ϕ]Sin[θ], Cos[θ]}, {ϕ, 0, 2π}, {θ, 0, π}, Mesh -> None]ChemicalDataは球と円柱を使って分子をプロットする:
ChemicalData["Caffeine", "MoleculePlot"]Import形式のいくつかは分子を表すのに球を使う:
Import["ExampleData/1PPT.pdb", "Rendering" -> "Spacefilling"]Circumsphereは球面上の点からSphereを指定する:
Subscript[ℛ, 1] = Circumsphere[{{0, 0, 1}, {0, 1, 0}, {1, 0, 0}, {0, 0, -1}}];
Subscript[ℛ, 2] = Sphere[{0, 0, 0}, 1];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]ImplicitRegionは任意のSphereを表すことができる:
Subscript[ℛ, 1] = ImplicitRegion[(Subscript[t, 1] - Subscript[c, 1])^2 + (Subscript[t, 2] - Subscript[c, 2])^2 + (Subscript[t, 3] - Subscript[c, 3])^2 == 1, {Subscript[t, 1], Subscript[t, 2], Subscript[t, 3]}];
Subscript[ℛ, 2] = Sphere[{Subscript[c, 1], Subscript[c, 2], Subscript[c, 3]}, 1];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]おもしろい例題 (4)
Graphics3D[Table[{Hue[RandomReal[]], Sphere[RandomReal[1, {3}], RandomReal[0.1]]}, {200}]]Graphics3D[Sphere[#, 1 / 2]& /@ Tuples[Range[-2, 2], 3]]Graphics3D[Sphere[#, 1 / Sqrt[2]]& /@ Select[Tuples[Range[-3, 3], 3], Mod[Total[#], 2] == 0&]]NIntegrateで使われたサンプル点:
{val, {data}} = Reap@NIntegrate[Boole[x ^ 2 + y ^ 2 + z ^ 2 < 1], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, EvaluationMonitor :> Sow[{x, y, z}], MaxRecursion -> 2];Graphics3D[Sphere[#, .05]& /@ data]テクニカルノート
関連するガイド
-
▪
- グラフィックスオブジェクト ▪
- 基本的な特殊領域 ▪
- 記号的なグラフィックス言語 ▪
- 立体幾何学 ▪
- 中学・高校における教育 ▪
- 平面幾何学
テキスト
Wolfram Research (2007), Sphere, Wolfram言語関数, https://reference.wolfram.com/language/ref/Sphere.html (2014年に更新).
CMS
Wolfram Language. 2007. "Sphere." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/Sphere.html.
APA
Wolfram Language. (2007). Sphere. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Sphere.html
BibTeX
@misc{reference.wolfram_2026_sphere, author="Wolfram Research", title="{Sphere}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Sphere.html}", note=[Accessed: 06-December-2026]}
BibLaTeX
@online{reference.wolfram_2026_sphere, organization={Wolfram Research}, title={Sphere}, year={2014}, url={https://reference.wolfram.com/language/ref/Sphere.html}, note=[Accessed: 06-December-2026]}