라텍스에 원형 모양 그리기

라텍스에 원형 모양 그리기

예를 들어 tikz 패키지를 사용하여 다음 그림을 플롯하고 싶지만 색상이 지정된 원형 모양을 얻는 방법을 모르겠습니다. (저는 이 페이지를 처음 접했기 때문에 질문이 너무 원시적이었다면 사과드립니다.) 여기에 이미지 설명을 입력하세요

답변1

스크린샷

소스 코드에 작성된 주석을 통한 설명입니다.

\documentclass[border=5mm]{standalone}

\usepackage{tikz}% this package is used to build figures
\usetikzlibrary{angles}% this library allows you to easily draw angles and add text to them. It requires these angles to be defined by 3 points with the operations \node or \coordinate. It is not possible to use coordinates such as (0,0). Thus, I defined 4 points named (a), (b), (o) and (d) when building the first path.
\usetikzlibrary{patterns}% this library allows you to fill the path with a repetitive pattern like a mosaic. I used the pattern `north east lines`.

\usepackage{siunitx}% this package defines the macro \ang{} which allows to correctly display angles in degrees.

\begin{document}

\begin{tikzpicture}      
\draw (60:3cm)coordinate(a)--(0,0)coordinate(o)--(-60:3cm)coordinate(b);  
% The curve is drawn using 2 bezier curves symmetrical to the horizontal axis. The first starts at `(0,0)` and ends at `(4,0)`. The two points `+(60:2)` and `+(90:2)` are the control points of this Béziers curve. The first control point is `+(60:2)`. The + sign means that its placement is relative to the starting point `(0,0)`. It is placed 2 cm from the starting point at an angle of 60°. The second control point `+(90:2)` is placed relative to the end of the bezier curve `(4,0)`. 
\draw[pattern color=red,pattern=north east lines] (0,0)..controls +(60:2) and +(90:2) .. (4,0)coordinate(d)..controls +(-90:2) and +(-60:2)..(0,0); 
\draw[->] (0,0)--(3,0);
\draw[dashed] (3,0)--(4.5,0);
\pic [draw,pic text=\ang{60},angle radius=5mm,angle eccentricity=1.6]{angle=d--o--a};
\pic [draw,pic text=\ang{60},angle radius=6mm,angle eccentricity=1.6]{angle=b--o--d};
\end{tikzpicture}


\end{document}

관련 정보