gpt4 book ai didi

r - 什么是方位角和纬度?

转载 作者:行者123 更新时间:2023-12-04 12:07:05 24 4
gpt4 key购买 nike

我正在使用 persp 并尝试更改视角。相关参数是 thetaphi 但不幸的是,文档非常神秘(?persp):

theta, phi: angles defining the viewing direction. theta gives the azimuthal direction and phi the colatitude.

详细信息部分,他们进行了一些更循环的解释:

The surface is... viewed by looking at the origin from a direction defined by theta and phi. If theta and phi are both zero the viewing direction is directly down the negative y axis. Changing theta will vary the azimuth and changing phi the colatitude.

自从我学习三维微积分来记住球坐标的所有名称以来,已经有一段时间了,无论如何,即使在那时,角度也从未被称为“方位角”或“余纬度”,而是简单地用希腊语来表示字母。

我能猜到的最接近的是来自维基百科的关于球坐标的图表:

A plot taken from Wikipedia. It's a 3D plot (three axes -- X, Y, and Z). It shows an arbitrary point in the 1st (all X,Y,Z positive) quadrant, labeled (r, theta, phi). theta is labeled as the angle between the vertical Z axis and the segment 'r' connecting the origin to the point. phi is labeled as the angle between the X axis and the projection of the point onto the XY plane.

这些与文档中提到的 thetaphi 相同吗?我知道数学符号如果不是作者之间令人烦恼的不一致的话就毫无意义。

最佳答案

像往常一样,解决这个问题的最简单方法(通常比去和 looking at the code 更容易,IMO:如果您愿意,请参阅链接中的 XRotateZRotate )是为了实验。

正如您在此处看到的,theta 围绕 Z 轴旋转,phi 围绕 X 轴旋转,因此 phi=90对应于俯 View ...即与上面显示的符号相反。

![enter image description here

复制代码:

x<-seq(0,2,len=11)
y<-seq(0,2,len=11)
z<-outer(x,y,function(x,y){
(x>1&y<=1)*2+(x<=1&y>1)*1+(x>1&y>1)*(1-(x-1)*(y-1))})

colors<-c(rep(rep(c("red","blue"),c(5,5)),5),
rep(rep(c("yellow","green"),c(5,5)),5))

par(mfrow=c(2,3))
persp(x,y,z,theta=0,phi=30,col=colors,main="Theta: 0")
persp(x,y,z,theta=60,phi=30,col=colors,main="Theta: 60")
persp(x,y,z,theta=120,phi=30,col=colors,main="Theta: 120")
persp(x,y,z,phi=0,col=colors,main="Phi: 0")
persp(x,y,z,phi=30,col=colors,main="Phi: 30")
persp(x,y,z,phi=60,col=colors,main="Phi: 60")

关于r - 什么是方位角和纬度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34141593/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com