在使用 Asymptote 绘制以下算式时,我得到了相同颜色的不同外观:A
和r
。purple
这是为什么?如何解决?
// Run on http://asymptote.ualberta.ca/
usepackage("xcolor");
unitsize(1cm);
real r=.8, R=1.5;
real d=2sqrt(R*r);
pair A=(0,r), B=(d,R); // AB^2 = 4Rr
pen pA=purple,pB=red;
draw((-1-r,0)--(d+R+.5,0));
draw(circle(A,r),pA);
draw(circle(B,R),pB);
dot("$A$",(0,0),S,pA,Fill(yellow));
dot("$B$",(d,0),S,pB,Fill(yellow));
label("$r$",A,pA);
label("$R$",B,pB);
label("${\color{purple}A}{\color{red}B}^2=4{\color{purple}r}{\color{red}R}$",point(NW),SE);
shipout(bbox(5mm,invisible));
答案1
在 asy 中使用 xcolor 对紫色的定义。
usepackage("xcolor");
unitsize(1cm);
// use xcolor purple
pen purple=rgb(.75,0,.25);
real r=.8, R=1.5;
real d=2sqrt(R*r);
pair A=(0,r), B=(d,R); // AB^2 = 4Rr
pen pA=purple,pB=red;
draw((-1-r,0)--(d+R+.5,0));
draw(circle(A,r),pA);
draw(circle(B,R),pB);
dot("$A$",(0,0),S,pA,Fill(yellow));
dot("$B$",(d,0),S,pB,Fill(yellow));
label("$r$",A,pA);
label("$R$",B,pB);
label("${\color{purple}A}{\color{red}B}^2=4{\color{purple}r}{\color{red}R}$",point(NW),SE);
shipout(bbox(5mm,invisible));