Forgot password?
 Create new account
View 176|Reply 1

双箭头

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2023-2-23 18:34:57 |Read mode
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: ...

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2023-3-3 02:40:54
在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. }
Copy the Code

在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

手机版Mobile version|Leisure Math Forum

2025-4-20 12:16 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list