Sagittarius Rover
Sagittarius Rover
这家伙很懒,什么也没写!

注册于 3年前

回答
456
文章
0
关注者
15

先解决原始问题

image.png

注意

\tkzGetAngle(angleADG)

\tkzGetAngle{angleADG}

看文档的例子:

image.png

所以,你只要把\tkzGetAngle(angleADG)替换为\tkzGetAngle{angleADG}即可

\documentclass[border=5pt]{standalone}
\usepackage{tkz-euclide}

\begin{document}
    \begin{tikzpicture}
        
        % ===== 定义点 =====
        \tkzDefPoints{0/0/C, 4/0/E}
        \tkzDefTriangle[two angles=23 and 37](C,E)
        \tkzGetPoint{B}
        
        \tkzDefPointBy[rotation=center B angle -90](C)
        \tkzGetPoint{A}
        \tkzDefPointBy[rotation=center B angle 90](E)
        \tkzGetPoint{D}
        
        \tkzCalcLength(B,D)
        \tkzGetLength{BDlen} 
        \tkzDefPointWith[linear normed, K=\BDlen](B,A) 
        \tkzGetPoint{G}
        
        \tkzFindAngle(A,D,G)
        \tkzGetAngle{angleADG}%<-注意花括号
        \tkzDefPointBy[rotation=center B angle \angleADG](A)
        \tkzGetPoint{f}
        \tkzInterLL(B,f)(A,D)
        \tkzGetPoint{F}
        

        % ===== 绘制图形 =====
        \tkzDrawPolygon[thick](B,C,E)
        \tkzDrawSegments[thick](A,B D,B A,C D,E A,D D,G B,F G,F)
        
    \end{tikzpicture}
\end{document}

一个workaround:

如果只要用一次,那么也可以直接用\tkzAngleResult,这样可以不用再\tkzGetAngle多写一行...

image.png

\documentclass[border=5pt]{standalone}
\usepackage{tkz-euclide}
\begin{document}
    \begin{tikzpicture}[font=\small]
        % ===== 定义点 =====
        \tkzDefPoints{0/0/C, 4/0/E}
        \tkzDefTriangle[two angles=23 and 37](C,E)
        \tkzGetPoint{B}
        
        \tkzDefPointBy[rotation=center B angle -90](C)
        \tkzGetPoint{A}
        \tkzDefPointBy[rotation=center B angle 90](E)
        \tkzGetPoint{D}
        
        \tkzCalcLength(B,D)
        \tkzGetLength{BDlen} 
        \tkzDefPointWith[linear normed, K=\BDlen](B,A) 
        \tkzGetPoint{G}
        
        \tkzFindAngle(A,D,G)
        % \tkzGetAngle(angleADG)
        \tkzDefPointBy[rotation=center B angle \tkzAngleResult](A)
        \tkzGetPoint{f}
        \tkzInterLL(B,f)(A,D)
        \tkzGetPoint{F}
        

        % ===== 绘制图形 =====
        \tkzDrawPolygon[thick](B,C,E)
        \tkzDrawSegments[thick](A,B D,B A,C D,E A,D D,G B,F G,F)
    \end{tikzpicture}
\end{document}

image.png

差不多就是小学生找规律问题((^_^))

07 -> (7,0)
23 -> (3,2)
152 -> (2,5)

使用取模和向下取整的函数即可,规律是显然的。

第一步:

先把「10-99」缩为一重循环;再把「100-199」也缩为一重循环即可

\documentclass[tikz,border=2pt]{standalone}
\usepackage{ctex}
\usepackage{circledtext}
\begin{document}
\tikz{
    \foreach \x in {0,...,9} {
        \node[scale=2.75]  at (\x,0) {\circledtext{\x}};
    }
    \foreach \x in {10,...,99}{%
        \pgfmathtruncatemacro{\xx}{mod(\x,10)}
        \pgfmathtruncatemacro{\yy}{floor(\x/10)}
        \node[scale=2.75] at (\xx,\yy) {\circledtext{\scalebox{1.25}[2]{\x}}};
    }%
}
\tikz{
    \foreach \x in {100,...,199}{%
        \pgfmathtruncatemacro{\xx}{mod(\x-100,10)}
        \pgfmathtruncatemacro{\yy}{floor((\x-100)/10)}
        \node[scale=2.75] at (\xx,\yy) {\circledtext{\scalebox{1}[2]{\x}}};
    }%
}
\end{document}

第二步:

根据数字的位数使用一个分支判断。这样可以把三个循环再缩为一个。

这里我不希望把0-199的数字拆分为两个tikzpicture,所以我稍微修改了一下逻辑和目标效果。

\documentclass[tikz,border=2pt]{standalone}
\usepackage{ctex}
\usepackage{circledtext}
\begin{document}
\tikz{
    \foreach \x in {0,...,299} {
        \pgfmathtruncatemacro{\xx}{mod(\x,10)}
        \pgfmathtruncatemacro{\yy}{floor(\x/10)}
        \ifnum\yy<1\relax
           \def\content{\x}
        \else%
            \ifnum\yy<10\relax
               \def\content{\scalebox{1.25}[2]{\x}}
            \else
               \def\content{\scalebox{1}[2]{\x}}
            \fi
        \fi
        \node[scale=2.75] at (\xx,\yy) {\circledtext{\content}};
    }%
}
\end{document}

image.png

我也来贡献一个可能的答案吧...

我其实见过Qrrbrbirlbel在这里的一个神级操作

\documentclass[tikz,border=8pt]{standalone}
\begin{document}
  \begin{tikzpicture}
    \path[draw]
    foreach \x[
        evaluate = \x as \angle using {360/12*(\x+1/2)}
    ] in {0,...,11} {
        node[
            shape=circle, color=black, draw, fill,
            inner sep=+0pt, minimum size=+2pt,
            label = {[anchor=\angle+180]{\angle}:$\x$},
            ] (a\x) at (\angle:1) {}
        }
    plot [sharp cycle, samples at = {0,...,11}] (a\x.center);
  \end{tikzpicture}
\end{document}

出于一些我比较菜的原因...我不知道是否有办法对plot加上-latex...

image.png

可以用on background layer来避免第二个循环

\documentclass[border=6pt]{standalone}
\usepackage{tkz-euclide}
\usetikzlibrary{backgrounds}
\pgfmathsetseed{42}
\begin{document}
\begin{tikzpicture}
\tkzDefPoint(0,-.5){b0}\tkzDrawPoints[size=3pt](b0)
\foreach \x[remember=\x as \lastx (initially 0)] in {1,...,16}{
    \begin{scope}[on background layer]
        \pgfmathrandominteger{\yy}{-2}{2}
        \tkzDefPoint(\x*0.5,\yy pt){b\x}
        \tkzDrawSegments(b\lastx,b\x)
    \end{scope}
    \tkzDrawPoints[size=3pt](b\x)
}
\end{tikzpicture}
\end{document}

上面的例子中的\pgfmathrandominteger是我刻意构造的,就是为了避免被「抖机灵」(是我的 恶意 ,我希望 直面 这种 17个点16根连线的 「循环」不方便的情况)

image.png

虽然点和线的绘制次序改变了,但「17个点16根连线」的问题还是会出现「冗余」的:

\tkzDefPoint(0,-.5){b0}\tkzDrawPoints[size=3pt](b0)

我再蹲一蹲。

首先,在对「CJK文字」进行下划线时,建议使用xeCJKfntef宏包来实现,否则会出现无法正确换行的情况。

原生的xeCJKfntef的功能

image.png

\documentclass[fontset=fandol,12pt]{ctexart}
\usepackage{xeCJKfntef}
\setlength{\parindent}{0pt}
\begin{document}

\CJKunderline{史记赵世家}

\CJKunderline*{史记赵世家}
    
\CJKunderwave{史记赵世家}

\CJKunderwave*{史记赵世家}

\CJKunderline{史记,赵世家}

\CJKunderline*{史记,赵世家}

\CJKunderline-{史}%
\CJKunderline-{记}%
,%
\CJKunderline-{赵}%
\CJKunderline-{世}%
\CJKunderline-{家}%

\CJKunderwave{史记,赵世家}

\CJKunderwave*{史记,赵世家}

\CJKunderwave-{史}%
\CJKunderwave-{记}%
,%
\CJKunderwave-{赵}%
\CJKunderwave-{世}%
\CJKunderwave-{家}%

\end{document}

image.png

另外,这种「逐字」需要下划线和下划波浪线的实际用途是什么(?)一般波浪线和下划线很少需要逐字添加绘制(?)

一个不成功的探索

最后,要想调好不借助现有功能是比较困难的:

  • 标点压缩
  • 标点禁则
  • 字符压缩

每个CJK字符最终呈现的宽度是并不统一的,我在xeCJkfntef的框架下做了如下修改,也有瑕疵...

\documentclass[fontset=fandol,12pt]{ctexart}
\usepackage{xeCJKfntef}
\usepackage{zhlipsum}
\setlength{\parindent}{0pt}
\ExplSyntaxOn
%Line 5716~5733
% \NewDocumentCommand \CJKunderline { s t- s o }
% {
%     \xeCJK_ulem_group_begin:
%     \xeCJK_fntef_boot:nnNNNn { underline } { uline } #1#2#3 {#4} 
%     \xeCJK_fntef_initial:nnn
%         { \l__xeCJK_uline_depth_tl }
%         { \l__xeCJK_uline_sep_tl }
%         {
%             \l__xeCJK_uline_format_tl
%             \tex_vrule:D
%             height \dim_eval:n { \l__xeCJK_uline_thickness_tl } 
%             depth \c_zero_dim
%             width .2em
%         }
%     \xeCJK_ulem_on:n
% }
\RenewDocumentCommand \CJKunderline { s t- s o }
{
    \xeCJK_ulem_group_begin:
    \xeCJK_fntef_boot:nnNNNn { underline } { uline } #1#2#3 {#4} 
    \xeCJK_fntef_initial:nnn{ \l__xeCJK_uline_depth_tl }{ \l__xeCJK_uline_sep_tl }{%
        \l__xeCJK_uline_format_tl
        \tex_vrule:D height \dim_eval:n { \l__xeCJK_uline_thickness_tl }  depth \c_zero_dim width .95em\hskip1pt}%
 \xeCJK_ulem_on:n
}
\ExplSyntaxOff

\xeCJKsetup{ underwave = { symbol = \sixly \hskip1pt plus 1fill minus 1fill\char 58\hskip0pt plus 1fill minus 1fill\char 58\hskip1pt plus 1fill minus 1fill\relax } }
\begin{document}

\CJKunderline{史记赵世家}

\CJKunderline*{史记赵世家}
    
\CJKunderwave{史记赵世家}

\CJKunderwave*{史记赵世家}

\CJKunderline{史记,赵世家}

\CJKunderline*{史记,赵世家}
    
\CJKunderwave{史记,赵世家}

\CJKunderwave*{史记,赵世家}

\end{document}

image.png

这里的刚性宽度控制在字更多的时候很容易「歪」,同时如果遇到压缩的标点符号/换行等特殊情况,也是难以正常工作的....

该问题的mwe可以更短

emotion或者emoji宏包只是使用lualatex编译的理由

% lualatex
\documentclass{ctexart}
\begin{document}
你好
\end{document}

可能有关:

其实关键问题点并没有解决

感觉是varwidth的基线和stretch的功能互相作用导致...

just a workaround

如果想要「每一行的高度至少有“3行那么高”,当然不一定必须是3行,也可以是3cm,5cm等」,似乎用ht会更方便(?)

\documentclass[border=2pt]{standalone}
\usepackage{ctex,tabularray,xcolor,varwidth}
\begin{document}
\begin{tblr}{
    colspec={Q[l,m]Q[l,m]},
    hlines={dashed},
    column{1}={fg=red,rightsep+=.2em},
    column{2}={font=\scriptsize,leftsep+=.2em},
    % stretch=3.5,
    rows = {ht = 3\baselineskip},
}
    \begin{varwidth}{4em}
        四个个字
    \end{varwidth}&
    \begin{varwidth}{50em}
        六个个个个字\texttt{Sixxxx}四个个字,六个个个个字
    \end{varwidth}\\
    \begin{varwidth}{4em}
        四个个字
    \end{varwidth}&
    \begin{varwidth}{50em}
        十二个个个个个个个个个字,五个个个字
    \end{varwidth}\\
    \begin{varwidth}{4em}
        四个个字
    \end{varwidth}&
    \begin{varwidth}{50em}
        八个个个个个个字,九个个个个个个个字
    \end{varwidth}\\
\end{tblr}
\end{document}

image.png

P.S 上述的7点需求似乎只有「2」与问题核心有关....为了让潜在的回答者少看文字,其他的内容或许可以更加省略...

如何延长线段长度

通过比例确定

\documentclass[border=4pt]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
    \tkzDefPoints{0/0/A, 2/0/B} 
    \tkzDrawPoints(A,B)
    \tkzDrawSegment[-Stealth](A,B)
    \tkzDefPointWith[linear,K=1.5](A,B)
    \tkzGetPoint{C}
    \tkzDefPointWith[linear,K=.75](A,B)
    \tkzGetPoint{D}
    \tkzDefPointWith[linear,K=-.5](A,B)
    \tkzGetPoint{E}
    \tkzDrawPoints[violet](C) % 1.5
    \tkzDrawPoints[cyan](D) % .75
    \tkzDrawPoints[olive](E)% -.5
    \tkzLabelPoints[above](A,B,C,D,E)
    \tkzDrawLine[gray,dashed,add=1 and 1](A,B)
\end{tikzpicture}
\end{document}

image.png

通过长度确定

读文档,不难发现...

image.png

对于linear normed,参数K为「绝对距离」。

\documentclass[border=4pt]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
    \tkzDefPoints{0/0/A, 2/0/B} 
    \tkzDrawPoints(A,B)
    \tkzDrawSegment[-Stealth](A,B)
    \tkzDefPointWith[linear normed,K=1.5](A,B)
    \tkzGetPoint{C}
    \tkzDefPointWith[linear normed,K=2.5](A,B)
    \tkzGetPoint{D}
    \tkzDefPointWith[linear normed,K=-1](A,B)
    \tkzGetPoint{E}
    \tkzDrawPoints[violet](C) % K=1.5 |AC|=1.5,|BD|=0.5
    \tkzDrawPoints[cyan](D) % K=2.5 |AD|=2.5,|BD|=0.5
    \tkzDrawPoints[olive](E)% K=-1 |EA|=1
    \tkzLabelPoints[above](A,B,C,D,E)
    \tkzDrawLine[gray,dashed,add=1 and 1](A,B)
\end{tikzpicture}
\end{document}

image.png

至此,假如已知BD=4.2的情况下,如何延长BA到点E,并且使AE = BD = 4.2,也就是延长绝对的数量;

应该是可以解决了...

如何获取线段的长度

假如BD长度未知,如何得到它的长度,并且延长BA到点E,并且使AE = BD的长度

在文档中也有类似的功能\tkzCalcLength

image.png

下面把|AB|设置为倾斜的,因此|AB|长度需要通过勾股定理,较难计算。同时我们预期在|AC|上延长这段长度...
\documentclass[border=4pt]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
    \tkzDefPoints{0/0/A, 1.5/0.25/B, 1/1/C}
    \tkzDrawPoints(A,B,C)
    \tkzLabelPoints(A,B,C) 
    \tkzDrawSegments[thick](A,B A,C)
    %计算|AB|的长度
    \tkzCalcLength(A,B)
    \tkzGetLength{dAB}
    %从C点反向延长距离为\dAB的长度
    \tkzDefPointWith[linear normed,K=-\dAB](C,A)
    \tkzGetPoint{D}
    \tkzDrawSegment[magenta,semithick](A,D)
    \tkzDrawPoints[magenta](D)
    \tkzLabelPoints[magenta](D) 
    \tkzDrawSegment[dim={\pgfmathprintnumber\dAB,6pt,}](C,D)
\end{tikzpicture}
\end{document}

image.png

挑个软柿子:

可以看到,以上代码高亮也有问题,我希望(原环境)可以高亮命令,比如 \begin, \end, \draw等,但现在只能高亮命令名,反斜杠不支持。如果使用 minted 库,一定程度上可以改进,但 minted 库需要调用 Pygments,编译速度很慢,我希望能规避

这个问题应该与tcolorboxexample无关,可以参考这个链接.

你有任何想法或者做过任何尝试吗?如果有,贴上代码是更好的。

最好不要问「do-it-for-me」类型的问题。

也许可以用表格,然后隐去部分垂直线(?)

P.S.我不太明白为什么此处的水平横线是断开的(?)

image.png


太痛苦了

主要同幂次项要对齐比较麻烦。

Claim:我只是为了展示tabularray是多么好评如潮

花了我大约50分钟进行微调...

\documentclass{article}
\usepackage{libertinus-otf}
\usepackage{lipsum}
\usepackage[showframe]{geometry}
\usepackage{tabularray}
% https://tex.stackexchange.com/a/659657/322482

\begin{document}
\lipsum[1][1-5]

\noindent
\begin{tblr}{
    % hlines, 
    % vlines,
    stretch = 2,
    colspec = {X[r]*{14}{Q[c]}X[l]},
    leftsep = 1pt,rightsep = 1pt,
    cells = {mode = dmath},
    vline{2,8,16} = {2}{2-Z}{},
    hline{4} = {2}{2-Y}{},
    hline{6} = {2}{2-7,11-Y}{},
    hline{8} = {2}{11-Y}{},
    column{1,2,7,8,Y,Z} = {leftsep=6pt,rightsep=6pt},
}
 & \SetCell[c=6]{c} g(x) &&&&&&\SetCell[c=8]{c} f(x) & \\
h_2(x)=-\frac{1}{2}+\frac{1}{4} & x^3&+&x^2&-&x&-1&  x^4&+&x^3&-3&x^2&-4&x&-1 & x=h_1(x) \\
 & x^3&+\frac{3}{2}&x^2&+\frac{1}{2}&x& & x^4&+&x^3&-&x^2&-&x& & \\
 &  & - \frac{1}{2} & x^2&-\frac{3}{2}&x&-1  &\SetCell[c=3]{r} r_1(x)=&&&-2&x^2&-3&x&-1 &\frac{8}{3}x+\frac{4}{3}=h_3(x) \\
 &  & - \frac{1}{2} & x^2&-\frac{3}{4}&x&-\frac{1}{4} & &&&-2&x^2&-2&x& & \\
 &  \SetCell[c=3]{r} r_2(x)=&& & -\frac{3}{4}&x&-\frac{3}{4} & &&&&&-&x&-1 & \\
 &  & &  &&& & &&&&&-&x&-1 & \\
 &  & &  &&& & &&&&&&&0 & \\
\end{tblr}

\lipsum[1][1-5]

\end{document}

但其实也有一些运算符之间对齐的细节并不够完美,有强迫症的可以在现有的16列上进一步增加关于「+/-」的对齐点位....

这将得到:

image.png

顺便期待一下tikz-matrix的处理方案...

难点就在于:

aligned 可以,不过对齐比较困难,matrix 内不支持 & 对齐。直接用 \nodeforeach 工作量也不小,主要同幂次项要对齐比较麻烦。

可以在y轴方向上缩放一点,让数字字符拉高/低一点
可以在x轴方向上缩放一点,让数字字符拉宽/瘦一点,以上这是两位数字的情况
当三(多)位数字时,在x轴方向上,数字字符可以再瘦一点,在y轴方向上,与两位数字的情况保持一致

其中「三(多)位数字」要「在y轴方向上,与两位数字的情况保持一致」,这样「2」似乎就会被拉长得的又高又瘦(?)个人觉得略显奇怪...

没完全解决上面的需求

如果只是要调大小的话,也许可以用charshrink来改善「222文字太小」的问题:

image.png

\documentclass{ctexart}
\usepackage{tikz}
\usepackage{circledtext}
\newcommand*{\mysingle}[1]{\circledtext[charshrink=.8]{#1}}
\newcommand*{\mydouble}[1]{\circledtext[charshrink=.85]{#1}}
\newcommand*{\mytriple}[1]{\circledtext[charshrink=.92]{#1}}

\begin{document}
\circledtext{2}\circledtext{22}\circledtext{222}

\tikz{\node[scale=5] {\circledtext{2}\circledtext{22}\circledtext{222}};}

\mysingle{2}\mydouble{22}\mytriple{222}

\tikz{\node[scale=5] {\mysingle{2}\mydouble{22}\mytriple{222}};}

\end{document}

image.png

side-notes:

  • 不建议用pdflatex编译ctexart
  • 若使用xelua,则无需显式写出UTF8,早已是默认值

感谢@u19850 鱼老师...
可以考虑用下面的方式实现将三个命令封装为一个...

image.png

如有可能,请做一些补充说明让这个问题变得更完整,清晰。

另外,真的要自定义新的样式吗?感觉这个工作量跟重写半个circuitikz包差不多大...如果只是新增某个「元件」符号感觉还相对好一点....

这样也许可以避免手动指定xshift=<dim>?

image.png

\documentclass{article}
\usepackage[margin=.8in,centering]{geometry}
\usepackage{showframe,lipsum,tikz,tkz-euclide}
\newcommand*{\inserttkz}[1][]{%
    \begin{tikzpicture}
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(2.5,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon[#1](A,B,C)
    \tkzLabelPoints(A,B,C)
    \end{tikzpicture}%
}
\begin{document}
\lipsum[1][1-3]

\fbox{
\begin{tikzpicture}[node distance=.5cm]
  \node (O) {\inserttkz};
  \node[right=of O] (O1) {\inserttkz[blue]};
  \node[right=of O1] (O2) {\inserttkz[magenta]};
  \node[right=of O2] (O3) {\inserttkz[olive]};
\end{tikzpicture}
}

\lipsum[1][1-3]

\end{document}

image.png

上面是这几天遇到的一个压轴题,请教大家怎么绘制。

其实也还是和tkz-euclide有些关系的

Code

先上完整代码:

\documentclass[border=3pt]{standalone}
\usepackage{libertine}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}[scale=1.5,thick,line cap=rounded]
    \tkzDefPoints{-1/0/B,1/0/C,0/sqrt(3)/A}
    \tkzDefPointWith[linear,K=.35](A,B)\tkzGetPoint{D}
    \tkzDefPointWith[linear,K=.35](C,A)\tkzGetPoint{E}
    \tkzInterLL(D,C)(B,E) \tkzGetPoint{F}
    \tkzDrawPolygon(A,B,C)
    \tkzDrawSegments(C,D B,E)
    \tkzLabelPoints[left](A,B,D)
    \tkzLabelPoints[right](C,E)
    \tkzLabelPoints[below](F)
    \node at (0,-.5) {Figure 1};
    \begin{scope}[xshift=3cm]
        \tkzDefPoints{-1/0/B,1/0/C,0/sqrt(3)/A}
        \tkzDefPointWith[linear,K=.35](A,B)\tkzGetPoint{D}
        \tkzDefPointWith[linear,K=.35](C,A)\tkzGetPoint{E}
        \tkzInterLL(D,C)(B,E) \tkzGetPoint{F}
        \tkzDrawPolygon(A,B,C)
        \tkzDrawSegments(C,D B,E)
        \tkzLabelPoints[left](A,B,D)
        \tkzLabelPoints[right](C,E)
        \tkzLabelPoints[below](F)
        %%%%%%%%%%%%%%%%%%%%
        \tkzDefPointBy[projection=onto C--D](B) \tkzGetPoint{G}
        \tkzDrawSegments(B,G A,G)
        \tkzLabelPoints[right](G)
        \node at (0,-.5) {Figure 2};
    \end{scope}
    \begin{scope}[xshift=6cm]
        \tkzDefPoints{-1/0/B,1/0/C,0/sqrt(3)/A,0/0/H,0/-0.2/l}
        \tkzDrawLine(A,H)
        \tkzDrawPolygon(A,B,C)
        \tkzLabelPoints[right](l)
        %%%%%%%%%%%%%%%%%%%%
        \tkzDefPointWith[linear,K=.3](A,H)\tkzGetPoint{M}
        %%%%%%%%%%%%%%%%%%%%
        \tkzDefTriangle[equilateral](M,C) 
        \tkzGetPoint{N}
        \tkzDrawSegments(B,N A,N)
        \tkzDrawPolygon(C,M,N)
        \tkzLabelPoints[below left](B,H)
        \tkzLabelPoints[below right](C)
        \tkzLabelPoints[left=-3pt](M)
        \tkzLabelPoints[right=-2pt](N)
        \tkzLabelPoints[above left](A)
        \node at (0,-.5) {Figure 3};
    \end{scope}
\end{tikzpicture}
\end{document}

image.png

大致思路

图一:基本问题点在于确定D和E的位置,在文档中找到:

image.png

image.png

所以核心代码是:

\tkzDefPointWith[linear,K=.35](A,B)\tkzGetPoint{D}
\tkzDefPointWith[linear,K=.35](C,A)\tkzGetPoint{E}

这里的K=0.35是可供调整的参数,我不懂初中几何,算不出来...算得出来准确比例直接写会更准确...

至于求交点,在之前的回答里也已经用过了:

\tkzInterLL(D,C)(B,E) \tkzGetPoint{F}

图二:基本难点在于「根据B向CD作垂线」

之前的问题也介绍过了,有projection方法:

image.png

\tkzDefPointBy[projection=onto C--D](B) 
\tkzGetPoint{G}

图三:难点在于「根据CM作等边三角形」

但其实你用了tkz-euclide也不难....熟知等边三角形的英文为equilateral,在文档中搜索即可:

image.png

\tkzDefTriangle[equilateral](M,C) 
\tkzGetPoint{N}

P.S.1 如果没有@u26254 老师的回答,我是万万不会想到用scope的(哭)

P.S.2 最好不要不做任何尝试就提问,单独画每一个图都不算难....

发布
问题