绘制角平分线

绘制角平分线

在此处输入图片描述

(1). 如何CAB如此精确地画出角的角平分线? (2). 如何P在角平分线上引入一个点,比如说?注意CPBP必须是垂直的。

    \documentclass[11pt,a4paper]{article}
    \usepackage{blindtext}
    \usepackage{tkz-euclide}
    \usetkzobj{all}
    \usepackage{color}
   \begin{document}
   \begin{center}
  \begin{tikzpicture}
  \tkzDefPoint(0,0){M}
  \tkzDefPoint(1.5,0){A}
  \tkzLabelPoints[below](A)
  \tkzDefPoint(12,0){N}
  \tkzDefPoint(10.5,0){B}
  \tkzLabelPoints[below](B)
  \tkzDrawSegment(M,N)
  \tkzDefPoint(9.0,7){L}
  \tkzDefPoint(7,5.1){C}
  \tkzLabelPoints[above](C)
  \tkzDrawSegment(A,L)
  \end{tikzpicture}
  \end{center}
  \end{document}

答案1

我搞不清楚 CP 和 BP 应该在哪里垂直。所以这是另一种变体。

    \documentclass[11pt,a4paper]{article}
    \usepackage{blindtext}
    \usepackage{tkz-euclide}
    \usetkzobj{all}
    \usepackage{color}
   \begin{document}
   \begin{center}
  \begin{tikzpicture}
  \tkzDefPoint(0,0){M}
  \tkzDefPoint(1.5,0){A}
  \tkzLabelPoints[below](A)
  \tkzDefPoint(12,0){N}
  \tkzDefPoint(10.5,0){B}
  \tkzLabelPoints[below](B)
  \tkzDrawSegment(M,N)
  \tkzDefPoint(9.0,7){L}
  \tkzDefPoint(7,5.1){C}
  \tkzLabelPoints[above](C)
  \tkzDrawSegment(A,L)
  \tkzDefLine[bisector](B,A,C)\tkzGetPoint{a}
  \tkzDrawSegment(A,a)
  \tkzDefPointWith[linear,K=0.6](A,a) \tkzGetPoint{D}
  \tkzDefPointBy[projection=onto A--C](D)
  \tkzGetPoint{h}
  \tkzDrawSegment(D,h)
  \tkzMarkRightAngle[fill=lightgray](A,h,D)
  %
  \tkzDefPointBy[projection=onto A--B](D)
  \tkzGetPoint{g}
  \tkzDrawSegment(D,g)
  \tkzMarkRightAngle[fill=lightgray](A,g,D)
  \end{tikzpicture}
  \end{center}
  \end{document}

在此处输入图片描述

答案2

您缺少的主要命令是\tkzDefMidPoint\tkzDefPointBy[projection=onto...],您可以按如下方式使用它们:

\tkzDefMidPoint(B,C)
\tkzGetPoint{P}

\tkzDefPointBy[projection=onto A--P](B)
\tkzGetPoint{R}

示例输出

虽然文档是法语的,它包含很多图片,所以通常不难找到命令。

\documentclass[11pt,a4paper]{article}

\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{color}

\begin{document}

\begin{center}
  \begin{tikzpicture}
    \tkzDefPoint(0,0){M}

    \tkzDefPoint(1.5,0){A}
    \tkzLabelPoints[below](A)

    \tkzDefPoint(12,0){N}

    \tkzDefPoint(10.5,0){B}
    \tkzLabelPoints[below](B)

    \tkzDrawSegment(M,N)

    \tkzDefPoint(9.0,7){L}

    \tkzDefPoint(7,5.1){C}
    \tkzLabelPoints[above](C)

    \tkzDrawSegment(A,L)

    \tkzDefMidPoint(B,C)
    \tkzGetPoint{P}

    \tkzDefPointBy[projection=onto A--P](B)
    \tkzGetPoint{R}

    \tkzDefPointBy[projection=onto A--P](C)
    \tkzGetPoint{S}

    \tkzDrawSegment(B,R)
    \tkzDrawSegment(A,R)
    \tkzDrawSegment(C,S)
    \tkzDrawSegment(A,S)

    \tkzDrawPoints(A,B,C,P)
    \tkzLabelPoints(P)
  \end{tikzpicture}
\end{center}

\end{document}

答案3

使用 MetaPost(在 LuaLaTeX 程序中)进行快速而粗略的尝试,希望它能引起一些人的兴趣。我这样做,就好像 MetaPost 无法自己计算给定角度的一半一样,并构造角平分线,通过角顶点和点 P,计算为两条垂直线的交点。(抱歉我的英语不太准确。)变量在whatever这里派上用场了。

画直角标记的宏不是我的,我借用了Metafun 手册作者:汉斯·哈根。

\documentclass{standalone}
\usepackage{luamplib}
  \mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}

vardef mark_right_angle (expr common, endofa, endofb, mark_size) =
 save tn ; tn := turningnumber(common -- endofa -- endofb -- cycle) ;
    ((1, 0) -- (1, 1) -- (0, 1))
    zscaled (mark_size*unitvector((1+tn)*endofa + (1-tn)*endofb - 2*common))
    shifted common
enddef ;

beginfig(1);
  u := cm; pair B, C, P;
  C = 5u*unitvector (5, 6); B = 5u*unitvector (7, 0);
  draw  origin -- 1.25C; draw u*(-1, 0) -- 1.5B;
  P = whatever[C, C + C rotated -90] = whatever[B, B + B rotated 90];
  draw C -- P -- B; draw origin -- 1.3P;
  draw mark_right_angle(C, origin, P, 2mm); draw mark_right_angle(B, origin, P, 2mm); 
  label.bot("$A$", origin); label.bot("$B$", B); label.ulft("$C$", C); label.lrt("$P$", P);
  setbounds currentpicture to bbox currentpicture scaled 1.1;
endfig;

\end{mplibcode}
\end{document}

在此处输入图片描述

答案4

我设置了一个新的简单的 tikz 命令来绘制角平分线。只需指定角度顶点,即可绘制角平分线。此命令基于尺规构造(几何),可以用基本几何来证明。

\documentclass{article}
%\usepackage{ctex}
%
%\usepackage{calc}
%\usepackage{xcolor}
%\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{
    calc,
    intersections,
    angles,
    quotes}
%
%\usepackage{animate}
%
%自定义函数,完成角ABC的平分线
%Customize the function to complete the bisector of angle ABC
\newcommand{\bisector}[3]{
    \path [dash dot] (#3) -- ++($(#1)-(#2)$) node [](P4){}; % CD//BA
    %计算CB的长度,并在CD上确定点E,使得CE=CB
    %Calculate the length of CB and determine the point E on CD such that CE = CB
    \path [] let \p1 = ($(#3)-(#2)$)    in  ($(#3)!veclen(\x1,\y1)!(P4)$) node[](P5){};
    % 连接BE,即得到角B的平分线
    %Connect BE to get the bisector of angle ABC
    \path [draw, color=red,
    %name path=bisectorN
    name path=b#1#2#3  %命名角平分线路径,以三个顶点来区分不同的角平分线。Name the paths to distinguish the different angle bisectors by their three vertices.
    ](#2) -- (P5) 
    pic[
    %"$\alpha$", 
    draw=orange, 
    <->, 
    angle eccentricity=1.2, 
    angle radius=1cm
    ]
    {angle=P5--#2--#3}
    ;
    %
}
\begin{document}
    \title{My command bisector}
    \maketitle
    
    \begin{figure}
        \centering
        \begin{tikzpicture}
            \draw [help lines](0,0)grid(4,4);
            %
            \draw(0,0) coordinate (A) node[left] {A}
            -- (4,0) coordinate (B) node[right] {B} %
            -- (4,4) coordinate (C) node[above] {C};
            \bisector{C}{B}{A};
            %
            \path[name path=AC](A)--(C);
            \path[name intersections={of=bCBA and AC}] (intersection-1)node[](D){D};
            %验证是否正确,注意顶点的顺序
            %Verify the half of angle ABC, pay attention to the order of the vertices
            %%计算 angle ABD,正向代表逆时针转动
            %%Calculate angle ABD, positive for counterclockwise rotation
            \pgfmathanglebetweenlines{\pgfpointanchor{D}{center}}{\pgfpointanchor{B}{center}}{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}} %

            %%%将得到的角度作为变量
            %Use the resulting angle as a variable
            \edef\angN{\pgfmathresult}
            \node at(2,0.5) {\angN};
            %
            \bisector{A}{B}{C};
 \pgfmathanglebetweenlines{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}{\pgfpointanchor{D}{center}}{\pgfpointanchor{B}{center}} 
            %将得到的角度作为变量
            %Use the resulting angle as a variable
            \edef\angN{\pgfmathresult}
            \node at(4,-1) {\angN} ;
        \end{tikzpicture}
        \caption{bisector:angle}
    \end{figure}
    
    \begin{figure}
        \centering
        \begin{tikzpicture}
            \draw (0,0)coordinate[label=A](A)--(4,0)coordinate[label=D](D)--($(D)!0.5!60:(A)$)coordinate[label=C](C)--+($(A)-(D)$)coordinate[label=B](B)--cycle;
            \draw[name path=AC](A)--(C) [name path=BD](B)--(D);
            \path[name intersections={of=AC and BD}](intersection-2)coordinate[label=O](O);%注意intersection-2!竟然有3个交点。
            \bisector{B}{A}{D};
            \path[name path=BC] (B)--(C);
            \path [name intersections={of= BC and bBAD}](intersection-1)coordinate[label=E](E);
            \draw (A)--(E) (O)--(E);
            %
            \draw[dashed] (E)--($(A)!2!(E)$)coordinate[label=F](F) (C)--(F);
            %
            \bisector{D}{C}{B};
            \path[name path=AD] (A)--(D);
            \path [name intersections={of= AD and bDCB}](intersection-1)coordinate[label=G](G);
            \draw (C)--(G) (O)--(G);
            %       %
            \draw[dashed] (G)--($(C)!2!(G)$)coordinate[label=H](H) (G)--(H);
            
        \end{tikzpicture}
        \caption{bisector:Parallelogram}
    \end{figure}
    
\end{document}

相关内容