将 Theta 和 Phi 的函数绘制为球体上的颜色图

Plotting a function of Theta and Phi as a color plot on a sphere

我正尝试在我的 class Matlab 上准备这个练习(作为 CS 工程师应用物理实验室的一部分),你必须模拟行星表面的温度波动,其一侧总是面向母星,一侧始终远离母星(一半 frozen-half 烘烤)。这是我正在使用的函数:

T(Theta, Phi) = T0 + T1*sin^2(Theta) + T2*(1+sin(Phi))

我想在球体表面绘制上述函数作为颜色图,即表面上点的颜色应该代表该点的温度 T。我该怎么做呢?

到目前为止我所做的一切都给了我一个这样的情节:

我想要像下图这样的东西,当然颜色分布不同,根据我上面给出的函数给出。

这是部分做到的:

T0 = 2 ; T1 = 30  ; T2 = 120 ; %// set your boundary conditions here

[X,Y,Z] = sphere(50) ; %// generate coordinates of a sphere
hs = surf(X,Y,Z)     ; %// display the sphere and retrieve the handle to the graphic object
axis equal           ; %// set the axis ratio so the sphere appear as a sphere
shading interp       ; %// small refinement to not see the grid, you can comment that

[azimuth,elevation,r] = cart2sph(X,Y,Z) ;               %// Convert cartesian coordinates to spherical referential
T = T0 + T1*sin(azimuth).^2 + T2.*(1+sin(elevation)) ;  %// Calculate the temperature according to your model
set(hs,'CData',T) ;                                     %// update the sphere graphic object with the new temperature as a collor coding

现在您仍然需要调整您的初始条件 T0T1T3,并且可能还需要添加一些旋转以防您的 "hot" 和 "cold" 点不在两极。