球坐标中的液滴

球坐标中的液滴

我正在研究液滴燃烧问题,首先我必须绘制球面坐标。我发现了这个

在圆柱坐标和球坐标中绘制

但我想在坐标原点绘制一个水滴(灰黑色),因为我的方程式设置在水滴外部。有人能帮我吗?

答案1

这是一个看起来像水滴的表面:

settings.outformat = "png";
settings.render = 4;
import three;

size(10cm);

path half_droplet = (0,1){dir(-90 + 10 /*degrees*/)} .. (0.3,0.5) .. {W}(0,0);

// Subdivide the path to produce a smoother image in the surface of revolution.
half_droplet = subpath(half_droplet, 0, 1) & 
    subpath(half_droplet, 1, 4/3) &
    subpath(half_droplet, 4/3, 5/3) &
    subpath(half_droplet, 5/3, 2);

path3 half_droplet_3d = path3(half_droplet, YZplane);
// Create a surface of revolution.
surface droplet = surface(half_droplet_3d, c=O, axis=Z, n=32);
draw(droplet, white);

要在图像中将水滴置于原点,例如https://tex.stackexchange.com/a/160528/484https://tex.stackexchange.com/a/275592/484,将以下代码附加到任一答案:

// draw inner "droplet" sphere

path half_droplet = (0,1){dir(-90 + 10 /*degrees*/)} .. (0.3,0.5) .. {W}(0,0);

// Subdivide the path to produce a smoother image in the surface of revolution.
half_droplet = subpath(half_droplet, 0, 1/2) & 
    subpath(half_droplet, 1/2, 1) &
    subpath(half_droplet, 1, 4/3) &
    subpath(half_droplet, 4/3, 5/3) &
    subpath(half_droplet, 5/3, 2);

path3 half_droplet_3d = path3(half_droplet, YZplane);
// Create a surface of revolution.
surface droplet = surface(half_droplet_3d, c=O, axis=Z, n=32);
// Shift the droplet to surround at the origin.
droplet = shift(-0.3Z) * droplet;
// Draw the droplet, scaled down.
draw(scale3(0.2r) * droplet, emissive(gray));

示例结果: 在此处输入图片描述

相关内容