![帮助几何图形](https://linux22.com/image/269531/%E5%B8%AE%E5%8A%A9%E5%87%A0%E4%BD%95%E5%9B%BE%E5%BD%A2.png)
有人可以帮我在 metapost 中创建这样的图形吗?
答案1
这没有什么困难的:
beginfig(1);
r=2cm; % radius
% vertices of the equilateral triangle
z0=origin;
z1=(r*cosd(30),r*sind(30));
z2=z1 reflectedabout (origin,(1,0));
% incenter of the equilateral triangle is the barycenter
3z3=z0+z1+z2;
path innertriangle,innercircle;
innertriangle=z0--z1--z2--cycle;
% radius of the inner circle
s=x1-x3;
innercircle=fullcircle scaled 2s shifted z3;
draw innertriangle;
draw innertriangle rotated 90;
draw innertriangle rotated 180;
draw innertriangle rotated 270;
draw innercircle;
draw innercircle rotated 90;
draw innercircle rotated 180;
draw innercircle rotated 270;
draw fullcircle scaled 2r;
endfig;
end.