SphericalDistance[{θ1,ϕ1},{θ2,ϕ2}]
単位球上の点{θ1,ϕ1}と点{θ2,ϕ2}の間の大円距離を返す.
SphericalDistance[{θ1,1,θ1,2,…,ϕ1},{θ2,1,θ2,2,…,ϕ2}]
単位超球の球面上の任意次元の点と点の間の測地線距離を返す.
SphericalDistance
SphericalDistance[{θ1,ϕ1},{θ2,ϕ2}]
単位球上の点{θ1,ϕ1}と点{θ2,ϕ2}の間の大円距離を返す.
SphericalDistance[{θ1,1,θ1,2,…,ϕ1},{θ2,1,θ2,2,…,ϕ2}]
単位超球の球面上の任意次元の点と点の間の測地線距離を返す.
詳細
- 球または超級の座標ベクトルは,CoordinateChartDataおよびCoordinateTransformDataと同じ慣習を使うが,最初の r 座標は削除する.
- 半径 r の超球上の測地線距離はSphericalDistanceの結果に半径 r を掛けて得ることができる.
- 2D球面上の点もGeoPosition[{lat,lon}]表記で指定できる.経緯度の単位は度である.
- SphericalDistanceは点のリストに縫い込まれる.SphericalDistance[point,points]は距離のリストを返し,SphericalDistance[points1,points2]は距離の行列を返す.
- SphericalDistanceは,数値データを扱っている場合に複素数入力は受け付けず,実数値出力だけを返す.
例題
すべて開く すべて閉じる例 (3)
SphericalDistance[{Pi / 4, 0}, {Pi / 3, Pi / 4}]SphericalDistance[{0.52, 0.63, 0.78}, {1.05, 1.57, 3.14}]pts = {{Pi / 2, 0}, {Pi / 2, Pi / 2}, {Pi / 2, Pi}, {Pi / 2, 3Pi / 2}}SphericalDistance[{0, 0}, pts]スコープ (5)
SphericalDistanceは厳密な数値入力を取る:
SphericalDistance[{Pi / 6, Pi / 5, Pi / 4}, {Pi / 3, Pi / 2, Pi}]SphericalDistanceは任意精度の数値入力を取る:
SphericalDistance[N[{Pi / 6, Pi / 5, Pi / 4}, 35], N[{Pi / 3, Pi / 2, Pi}, 35]]SphericalDistanceは記号入力に使うことができる:
SphericalDistance[{a, b}, {c, d}]矩形DistanceMatrixを計算し,結果をArrayPlotで表示する:
SeedRandom[1234];
ArrayPlot[SphericalDistance[RandomReal[Pi, {5, 4}], RandomReal[Pi, {10, 4}]]]SphericalDistanceにはGeoPosition[{lat,lon}]表記の点が使える:
SphericalDistance[GeoPosition[{80.0, 87.0}], GeoPosition[{50.0, 135.3}]]点のGeoPositionリストを使う:
SphericalDistance[GeoPosition[{{80.0, 87.0}, {50.0, 60.0}}], GeoPosition[{50.0, 135.3}]]アプリケーション (3)
SeedRandom[1234];
pts = RandomReal[Pi / 2, {3, 2}]distances = SphericalDistance@@@Subsets[pts, {2}]AllTrue[{{{1, 2}, 3}, {{2, 3}, 1}, {{3, 1}, 2}}, Function[Greater[Total[distances[[First[#]]]],
distances[[Last[#]]]]]]fun = Function[t, {Pi / 2 + Pi / 4 Cos[2t], t}]curve = N[fun /@ Range[0, 2Pi, 2Pi / 1000]];Graphics3D[{Darker[Blue], Thick,
Line[Transpose[FromSphericalCoordinates[{1, θ, ϕ}] /. {θ -> First[Transpose[curve]], ϕ -> Last[Transpose[curve]]}]], Opacity[.75], LightGray, Sphere[]}, Lighting -> AmbientLight[White],
ViewVertical -> {0, 0, 1}, ViewPoint -> {85, 315, 53}, Boxed -> False
]Total[MapApply[SphericalDistance, Partition[curve, 2, 1]]]octahedron = Join[{{0, 0}, {Pi, 0}}, {Pi / 2, # Pi / 2}& /@ Range[0, 3]]SphericalDistance[First[octahedron], octahedron]SphericalDistance[octahedron, octahedron]SymmetricMatrixQ[%]特性と関係 (5)
SphericalDistance[{Pi / 2, Pi / 5}, {Pi / 2, Pi / 2}]SphericalDistance[{Pi / 5, Pi}, {Pi / 2, Pi}]Pi / 2 - Pi / 5SeedRandom[1234];
{a, b} = RandomReal[Pi, {2, 2}]{p, q} = FromSphericalCoordinates[Prepend[#, 1]& /@ {a, b}]SphericalDistanceとVectorAngleの結果と比較する:
SphericalDistance[a, b]VectorAngle[p, q]% - %%EuclideanDistanceの結果は,常にSphericalDistanceの結果より小さい:
EuclideanDistance[p, q]SphericalDistance[a, b]stars = {Entity["Star", "Rigel"], Entity["Star", "Betelgeuse"]};AstroGraphics[stars,
AstroReferenceFrame -> "Equatorial", AstroRange -> Quantity[15, "AngularDegrees"]]Apply[SphericalDistance,
Times[{90, 0} - AstroPosition[#, "Equatorial"]["Data"][[{2, 1}]],
Degree]& /@ stars]AstroAngularSeparationの結果と比較する:
Normal[AstroAngularSeparation[#1, #2, Entity["Star", "Sun"]]&@@stars ]GeoPositionを使って座標を指定する:
p = GeoPosition[{80.0, 87.0}];
q = GeoPosition[{50.0, 135.3}];SphericalDistance[p, q]楕円体の地球上でGeoDistanceを計算する:
GeoDistance[p, q]Divide[%, Entity["Planet", "Earth"]["Radius"]]SphericalDistance[{a, b}, {c, d}]実数上で簡約したVectorAngleの結果と比較する:
Simplify[VectorAngle[FromPolarCoordinates[{1, a, b}], FromPolarCoordinates[{1, c, d}]], {a, b, c, d}∈Reals]考えられる問題 (1)
SphericalDistanceの使い方を変えると異なる結果が返されるかもしれない:
res1 = SphericalDistance[{a1, a2, a3}, {{b1, b2, b3}}]res2 = SphericalDistance[{a1, a2, a3}, {b1, b2, b3}]First[res1] == res2//Simplifyおもしろい例題 (1)
tetrahedronPts = Function[{
{#1, #2}, {Pi - #1, -#2}, {Pi - #1, 3#2}, {#1, -3#2}
}][ArcTan[Sqrt[2]], Pi / 4]With[{cartesian = FromSphericalCoordinates[
Prepend[#, 1]]& /@ tetrahedronPts},
Graphics3D[{Line /@ Subsets[cartesian, {2}],
Red, Line[Nest[Riffle[#,
Normalize @* Mean /@ Partition[#, 2, 1]
]&, #, 5]]& /@ Subsets[cartesian, {2}],
LightGray, Opacity[.5], Sphere[]},
Lighting -> AmbientLight[White],
Boxed -> False, ViewVertical -> {0, 0, 1},
ViewPoint -> {2, -3, 4}
]
]SphericalDistance[tetrahedronPts, tetrahedronPts]テキスト
Wolfram Research (2023), SphericalDistance, Wolfram言語関数, https://reference.wolfram.com/language/ref/SphericalDistance.html.
CMS
Wolfram Language. 2023. "SphericalDistance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SphericalDistance.html.
APA
Wolfram Language. (2023). SphericalDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SphericalDistance.html
BibTeX
@misc{reference.wolfram_2026_sphericaldistance, author="Wolfram Research", title="{SphericalDistance}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/SphericalDistance.html}", note=[Accessed: 03-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_sphericaldistance, organization={Wolfram Research}, title={SphericalDistance}, year={2023}, url={https://reference.wolfram.com/language/ref/SphericalDistance.html}, note=[Accessed: 03-November-2026]}