Forgot password?
 Create new account
Author: aaa

请问如何标记直角符号?

[Copy link]

11

Threads

24

Posts

209

Credits

Credits
209

Show all posts

 Author| aaa Posted at 2019-3-18 15:06:50
Last edited by hbghlyj at 3 days ago回复 11# kuing
谢谢kuing

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2019-3-20 17:04:52
Last edited by hbghlyj at 3 days ago继续,来试一下仿照 11# 的方法做一个弧标记:
  1. \newlength\hur%弧半径
  2. \newlength\huj%字母与弧的间距
  3. \hur=7pt
  4. \huj=5pt
  5. \newcommand\hubj[5][]{%
  6. \draw[#1] let \p1=(#2),\p2=(#4),\p0=(#3),
  7. \n1={atan2(\y1-\y0,\x1-\x0)},
  8. \n2={atan2(\y2-\y0,\x2-\x0)},
  9. \n3={Mod(\n2-\n1,360)} in
  10. (#3)++(\n1:\hur)arc[start angle=\n1,delta angle=\n3,radius=\hur]
  11. (#3)+(\n1+0.5*\n3:\hur+\huj) node {$#5$};
  12. }
Copy the Code
用的时候要注意点的顺序,我的设计是让它总是逆时针。
举个栗子:
  1. \tikz{
  2. \coordinate[label=right:$A$] (A) at (2,0);
  3. \coordinate[label=below left:$B$] (B) at (1.75,1.75);
  4. \coordinate[label=left:$C$] (C) at (0,1.5);
  5. \draw (A)--(B)--(C)--cycle;
  6. \hubj ACBx
  7. \hubj BACy
  8. \hubj[red,thick]ABCz
  9. }
Copy the Code
效果是:

特别需要指出的是 \n3={Mod(\n2-\n1,360)} 这一句,为什么要 mod 360?不 mod 会出啥问题?大家不妨想想。

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2019-3-20 17:41:53
将 11# 及楼上的整合在一起,写个测试文档: $type zjbj_hubj.tex (1.72 KB, Downloads: 991) 其中后面是随机点测试。

我是不是太闲了哩?

418

Threads

1627

Posts

110K

Credits

Credits
11886

Show all posts

abababa Posted at ereyesterday 11:58
Last edited by hbghlyj at ereyesterday 21:44平面几何的话,还是觉得tkz-euclide方便:
  1. \begin{tikzpicture}[scale=1,label style/.style={font=\scriptsize}]
  2. \tkzDefPoints{0/0/O,2/0/A,0/2/B}
  3. \tkzDefPointWith[linear,K=0.3](A,B)\tkzGetPoint{P}
  4. \tkzDefMidPoint(O,A)\tkzGetPoint{M}
  5. \tkzDefPointBy[projection= onto A--B](M)\tkzGetPoint{T}
  6. \tkzDrawSegments[color=black](O,A O,B A,B O,P)
  7. \tkzDrawSegments[dashed,color=black](M,P)
  8. \tkzDrawSegments[color=cyan](M,T)
  9. \tkzLabelPoints[below left][color=black](O)
  10. \tkzLabelPoints[below right][color=black](A)
  11. \tkzLabelPoints[above][color=black](B)
  12. \tkzLabelPoints[above right][color=black](P)
  13. \tkzLabelPoints[below][color=black](M)
  14. \tkzDrawPoints[color=black,fill=black](O,A,B,P,M,T)
  15. \tkzMarkRightAngle[color=red, size=0.1](M,T,A)
  16. \end{tikzpicture}
Copy the Code


手机版Mobile version|Leisure Math Forum

2025-4-20 12:09 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list