\tkzShowLine[orthogonal=trough ....] 中的選項“size”

\tkzShowLine[orthogonal=trough ....] 中的選項“size”

我希望更接近重點D使用 出現指南針標記\tkzShowLine[orthogonal....]。不幸的是,該選項size=沒有任何效果,正如您在下面的最小範例中看到的那樣。

提前謝謝!

\documentclass{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}       

\begin{document}
\begin{tikzpicture}
\tkzDefPoints{0/0/A,3/0/B,0/3/C, 1.5/1.5/D}
\tkzDefPointWith[orthogonal](D,B) \tkzGetPoint{E}
\tkzShowLine[orthogonal=through D,size=.5,color=orange,gap=-2](B,C)
\tkzShowLine[orthogonal=through D,size=2.5,color=red,gap=-3](B,C)
\tkzShowLine[orthogonal=through D,size=100,color=green,gap=-4](B,C)
\tkzDrawPolygon(A,B,C)
\tkzDrawPoints(A,B,C,E,D)
\tkzDrawLine[color=blue](A,E)
\tkzLabelPoints[below left](A)
\tkzLabelPoints[below right](B,E)
\tkzLabelPoints[above left](C)
\tkzLabelPoints[below](D)
\end{tikzpicture}
\end{document}

在此輸入影像描述

答案1

圖中有四個指南針標記。你可以用 修改四個標記的長度length,然後你可以用 修改直線(BC)上標記的距離size(不幸的是我忘記了一小段代碼size ,即使是最新版本也不起作用。我修改了代碼今天然後是gap用D修改最後兩個標記的距離的選項。

接下來的程式碼是用新版本編譯的 在 CTAN 上版本號為 3.01c。下面的程式碼將在下週的3.02版本中引入。我忘了係數\tkz@show@size

\documentclass{standalone} 
\usepackage{tkz-euclide}   

\makeatletter
\def\tkzShowOrthLine{\pgfutil@ifnextchar[{\tkz@ShowOrthLine}{\tkz@ShowOrthLine[]}} 
\def\tkz@ShowOrthLine[#1](#2,#3)(#4){% 
\begingroup
\pgfkeys{show/.cd,  
          ratio   = .75,
          length  = 1,
          gap     = -1,
          size    = 1} 
\pgfkeys{show/.cd,#1}
    \tkzVecKOrth(#2,#3)                
    \pgfnodealias{tkz@OLtmp}{tkzPointResult}
    \tkz@VecKCoLinear[1](#2,tkz@OLtmp,#4)      
    \pgfnodealias{tkzPointCo}{tkzPointResult}
    \tkzInterLL(#2,#3)(#4,tkzPointCo)
    \pgfnodealias{tkzPOpoint}{tkzPointResult}
    \tkzCalcLength(#4,tkzPOpoint)           
    \tkzGetLength{tkz@mathLen}
    \tkz@VecKNorm[1](#2,#3)
    \pgfnodealias{PO@tmp}{tkzPointResult}
    \tkz@VecKCoLinear[1](#2,PO@tmp,tkzPOpoint)  
    \pgfnodealias{PO@tmp2}{tkzPointResult}
    \tkz@VecKCoLinear[-1](#2,PO@tmp,tkzPOpoint)
    \pgfnodealias{PO@tmp1}{tkzPointResult}
    \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp1,tkzPOpoint) 
    \pgfnodealias{PO@1}{tkzPointResult}
    \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp2,tkzPOpoint)
    \pgfnodealias{PO@2}{tkzPointResult}
    \ifdim\tkz@mathLen pt>10 pt\relax
        \tkz@VecKNorm[1](#4,tkzPOpoint)
        \pgfnodealias{PO@tmp1}{tkzPointResult}
      \else
        \tkz@VecKOrthNorm[1](tkzPOpoint,PO@2)
        \pgfnodealias{PO@tmp1}{tkzPointResult}
     \fi
    \tkz@VecKCoLinear[-\tkz@show@gap](PO@tmp1,tkzPOpoint,tkzPOpoint)
    \pgfnodealias{PO@3}{tkzPointResult}
    \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@1)
    \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@2)
    \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](PO@1,PO@3)
    \tkzCompass[#1,length=\tkz@show@length](PO@2,PO@3) 
\endgroup
} 
\makeatother

\begin{document}
\begin{tikzpicture}
\tkzDefPoints{0/0/A,3/0/B,0/3/C, 1.5/1.5/D}
\tkzDefPointWith[orthogonal](D,B) \tkzGetPoint{E}
\tkzShowLine[orthogonal=through D,color=orange,length=.5,size=1,gap=-1](B,C)
\tkzShowLine[orthogonal=through D,color=green,length=.75,size=.5,gap=-.75](B,C)
\tkzDrawPolygon(A,B,C)
\tkzDrawPoints(A,B,C,E,D)
\tkzDrawLine[color=blue](A,E)
\tkzLabelPoints[below left](A)
\tkzLabelPoints[below right](B,E)
\tkzLabelPoints[above left](C)
\tkzLabelPoints[below](D)
\end{tikzpicture}

\end{document}

在此輸入影像描述

相關內容