找回密码
 快速注册
搜索
查看: 47|回复: 1

双箭头

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-2-23 18:34 |阅读模式
How to define a custom ArrowHead in Asymptote?
In this figure, in order to draw "DoubleHead", I made a precedure to draw SimpleHead repetitively, but can we define an ArrowHead "DoubleHead", similar to \draw[->>] in TikZ?

Related

Asymptote FAQ - Section 5 Questions about arrows
Q5.1 How do I draw two arrows at arbitrary positions along a path? Assuming that at least one of the arrowheads is to be filled, you can do this: ...

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-3-3 02:40
在Aops community / Aops blog使用的TeXeR支持的Asymptote, 自动import olympiad.asyCSE5.asy
The Asymptote CSE5 package is another package that is supported on the AoPS forum
在olympiad中有一个pathticks可以画1#的多重箭头
Olympiad5[1].gif
查看源码
  1. // A picture marking a path g with n ticks spaced spacing apart, with length s in ps points
  2. // such that the middle tick mark (or one of the two if n is even) is normal to g
  3. // and located r of the way along path g:
  4. picture pathticks(path g, int n=1, real r=.5, real spacing=6, real s=8, pen p=currentpen)
  5. {
  6.         picture pict;
  7.         pair A,B,C,direct;
  8.         real t,l=arclength(g), space=spacing*markscalefactor, halftick=s*markscalefactor/2, startpt;
  9.         if (n>0)
  10.         {  
  11.                 direct=unit(dir(g,arctime(g,r*l)));  
  12.                 startpt=r*l-(n-1)/2*space;  
  13.                 for (int i=0; i<n; ++i)  
  14.                 {  
  15.                         t=startpt+i*space;  
  16.                         B=point(g,arctime(g,t))+(0,1)*halftick*direct;  
  17.                         C=B+2*(0,-1)*halftick*direct;  
  18.                         draw(pict,B--C,p);  
  19.                 }
  20.         }
  21.         return pict;
  22. }
复制代码

在geometry.asy有一个markangle用来标角, 见tex.stackexchange.com/questions/597937
而在olympiad.asy有anglemark, 应该是功能扩展的. 和rightanglemark用来标直角. 例如
filldraw(anglemark((5,0),(0,0),(3,4)),green,red+linewidth(1));
c983d61ea7b9e59cf42ebcfb695cea4ca2ec76d0[1].png

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 12:44

Powered by Discuz!

× 快速回复 返回顶部 返回列表