곡선 보간

곡선 보간

나는 이 곡선을 보간하려고 시도했지만 내가 얻은 결과는 그리 좋지 않았습니다. 여기에 이미지 설명을 입력하세요

내가 시도한 것 :

\documentclass[french,25pt,a4paper,landscape]{article}
\usepackage{etex}

\usepackage{tikz}
\usepackage[T1]{fontenc}
\usepackage{xcolor}



\begin{document}
    \begin{center}
        \definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
            \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
            \definecolor{qqqqff}{rgb}{0,0,1}
            \begin{tikzpicture}[line cap=round,line join=round,>=stealth,x=1cm,y=1cm]
            \coordinate[label=below:$O$] (A) at (0,0);
            \coordinate[label=below left:] (B) at (0,4);
            \coordinate[label=below left:$t$] (C) at (4,0);
            
            \coordinate[label=above right:] (D) at (0.54,1.04);
            \coordinate[label=above right:] (E) at (1.38,1.58);
            \coordinate[label=above right:] (F) at (1.9,1.667);
            \coordinate[label=above right:] (G) at (2.76,1.767);
            \coordinate[label=above right:] (H) at (4.36,1.8);

            \coordinate[label=above right:] (I) at (0.3,3.82);
            \coordinate[label=above right:] (J) at (0.5,3.5);
            \coordinate[label=above right:] (K) at (0.7,2.94);
            \coordinate[label=above right:] (L) at (0.84,2.44);
            \coordinate[label=above right:] (M) at (1,2);
            \coordinate[label=above right:] (N) at (1.24,1.36);
            \coordinate[label=above right:] (O) at (1.86,0.86);
            \coordinate[label=above right:] (P) at (2.44,0.54);
            \coordinate[label=above right:] (Q) at (2.86,0.22);
            \coordinate[label=above right:] (R) at (3.42,0.18);

            \coordinate[label=above right:] (S) at (0.84,0.38);
            \coordinate[label=above right:] (T) at (1.61,1.04);
            \coordinate[label=above right:] (U) at (1.92,1.68);
            \coordinate[label=above right:] (V) at (2.52,3.04);
            \coordinate[label=above right:] (W) at (2.84,4.32);
            

            
            \draw [->,line width=0.8pt] (A) -- (B) node[midway, below left] {};
            \draw [->,line width=0.8pt] (A) -- (C) node[midway, above] {};

            \draw [red] plot [smooth, tension=0.6] coordinates { (A) (D) (E) (F) (G) (H)};
            \draw [blue, dashed] plot [smooth, tension=0.6] coordinates { (I) (J) (K) (L) (M) (N) (O) (P) (Q) (R)};

            \draw [green] plot [smooth, tension=0.6] coordinates { (A) (S) (T) (U) (V) (W)};
            
            \fill (A) circle (2pt);
            \fill (B) circle (0pt);
            \fill (C) circle (0pt);
            \end{tikzpicture}
    \end{center}
\end{document}

결과 :

여기에 이미지 설명을 입력하세요

곡선이 더욱 실제처럼 보이도록 하려면 어떻게 해야 합니까? 그리고 동그라미 안의 숫자도 추가하고 싶습니다.

답변1

이를 수행하는 방법은 다음과 같습니다. 열쇠:

  • 예제에서 불필요한 코드 제거
  • --다음으로 대체to[out=,in=]
  • 파란색 곡선의 중간점을 지정합니다.
  • 이동하기 위해 몇 가지 변형을 사용하여 각 곡선의 끝에 레이블을 배치합니다.

controls베지어 곡선을 통한 다른 접근 방식인 을 사용할 수도 있습니다 . 시각화하기가 더 쉬워지는 효과를 발견했습니다 to.

standalone클래스를 사용 하고 패키지를 통해 해당 PDF를 포함하여 별도의 파일로 그래픽을 그리는 것이 좋습니다 graphicx. 여기를 참조하세요한 가지 예, 내가 그렇게 하자고 제안했지만여러 번 (더 찾아보세요).

결과

%\documentclass[french,25pt,a4paper,landscape]{article}
%\usepackage{etex}
%
%\usepackage{tikz}
%\usepackage[T1]{fontenc}
%\usepackage{xcolor}

\documentclass[10pt,border=3mm,tikz]{standalone}

\begin{document}
%    \begin{center}

% ~~~ you don't use them here ... ~~~~~~~~~~~~~~~~~~~~~
%        \definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
%        \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
%        \definecolor{qqqqff}{rgb}{0,0,1}
        
        
 \begin{tikzpicture}[
    line cap=round,
    line join=round,
    >=stealth,
    lbl/.style={draw,circle},
%   x=1cm,y=1cm
    ]
            \coordinate[label=below:$O$] (A) at (0,0);
            \coordinate[label=below left:] (B) at (0,4);
            \coordinate[label=below left:$t$] (C) at (4,0);
%            
%            \coordinate[label=above right:] (D) at (0.54,1.04);
%            \coordinate[label=above right:] (E) at (1.38,1.58);
%            \coordinate[label=above right:] (F) at (1.9,1.667);
%            \coordinate[label=above right:] (G) at (2.76,1.767);
            \coordinate[label=above right:] (H) at (4.36,1.8);
%
            \coordinate[label=above right:] (I) at (0.3,3.82);
%            \coordinate[label=above right:] (J) at (0.5,3.5);
%            \coordinate[label=above right:] (K) at (0.7,2.94);
%            \coordinate[label=above right:] (L) at (0.84,2.44);
%            \coordinate[label=above right:] (M) at (1,2);
%            \coordinate[label=above right:] (N) at (1.24,1.36);
%            \coordinate[label=above right:] (O) at (1.86,0.86);
%            \coordinate[label=above right:] (P) at (2.44,0.54);
%            \coordinate[label=above right:] (Q) at (2.86,0.22);
            \coordinate[label=above right:] (R) at (3.42,0.18);
%
%            \coordinate[label=above right:] (S) at (0.84,0.38);
%            \coordinate[label=above right:] (T) at (1.61,1.04);
%            \coordinate[label=above right:] (U) at (1.92,1.68);
%            \coordinate[label=above right:] (V) at (2.52,3.04);
            \coordinate[label=above right:] (W) at (2.84,4.32);
            

    % ~~~ y- and x-axis ~~~~~~~~~~~~~~~~~~~~~~~~~
    \draw [->,line width=0.8pt] (A) -- (B) node[midway, below left] {?};
    \draw [->,line width=0.8pt] (A) -- (C) node[midway, above] {??};

    % ~~~ curves ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    %\draw[red] (A) -- (H); % start like this
    \draw[red]      (A) to[out=60,in=182] (H) node[lbl,yshift=4mm] {3}; % refined
    \draw[teal!80]  (A) to[out=20,in=250] (W) node[lbl,shift=(200:7mm)] {1};
    \draw[blue,dashed]
                    (I) to[out=-35,in=110] +(.7,-1.6) 
                        to[out=290,in=180] (R) node[lbl,shift=(120:7mm)] {2};
    
    %\draw [red] plot [smooth, tension=0.6] coordinates { (A) (D) (E) (F) (G) (H)};
    %\draw [blue, dashed] plot [smooth, tension=0.6] coordinates { (I) (J) (K) (L) (M) (N) (O) (P) (Q) (R)};

    %\draw [green] plot [smooth, tension=0.6] coordinates { (A) (S) (T) (U) (V) (W)};
            
    \fill (A) circle (2pt);
    \fill (B) circle (0pt);
    \fill (C) circle (0pt);
 \end{tikzpicture}
%    \end{center}
\end{document}

관련 정보