帮助几何图形

帮助几何图形

有人可以帮我在 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.

在此处输入图片描述

相关内容