勵志

勵志人生知識庫

球座標轉換

球坐標直角坐標之間的轉換關係如下:

球坐標轉換為直角坐標:

( x = r\sin\theta\cos\phi )

( y = r\sin\theta\sin\phi )

( z = r\cos\theta )

直角坐標轉換為球坐標:

( r = \sqrt{x^2 + y^2 + z^2} )

( \theta = \arccos\left(\frac{z}{r}\right) )

( \phi = \arctan\left(\frac{y}{x}\right) )

基底變換:

( \hat{r} = \sin\theta\cos\phi\hat{x} + \sin\theta\sin\phi\hat{y} + \cos\theta\hat{z} )

( \hat{\theta} = \cos\theta\cos\phi\hat{x} + \cos\theta\sin\phi\hat{y} - \sin\theta\hat{z} )

( \hat{\phi} = -\sin\phi\hat{x} + \cos\phi\hat{y} )

以上關係提供了球坐標和直角坐標之間的轉換方法,以及如何在兩個坐標系之間變換基底向量。