TikZ에서 원의 반전을 그리는 방법은 무엇입니까?

TikZ에서 원의 반전을 그리는 방법은 무엇입니까?

점 P와 중심 O의 반전은 선 OP를 따라 제품 OP가 되는 또 다른 점 P'입니다. OP' = k, 즉 상수 k이다. 아래 그림과 같이 점 O(원 안에 있지 않음)를 기준으로 한 원의 반전은 또 다른 원입니다. 원형의 반전

TikZ에서 두 번째 원을 첫 번째 원의 (올바른) 반전으로 그리는 것이 가능합니까? 나는 변환, 회전 및 기타 선형 변환을 수행하는 것이 쉽다는 것을 알고 있지만 반전은 본 적이 없습니다.

답변1

TikZ 솔루션을 기다리는 동안 다이어그램을 작성하는 간단한 방법은 다음과 같습니다.메타포스트. 기본 기하학이 잘 설명되어 있습니다.수학세계에서, (비록 다이어그램에는 점의 반전이 표시되어 있지만밖의반전의 원; 여기서의 경우 는 반전 원 안에 있기 때문에 P과 의 역할이 P'반대입니다 .P

여기에서는 반전 원 부분의 윤곽을 희미한 분홍색으로 추가하여 작동 방식을 좀 더 명확하게 만들었습니다. 물론 필요하지 않은 경우 분홍색 호를 제거할 수도 있습니다.

반전이 있는 원

prologues := 3;
outputtemplate := "%j%c.eps";

vardef invert_point(expr p, k) = 
  if abs(p)>0:
    unitvector p scaled (k/abs(p)) scaled k
  else:
    origin % strictly this should be a point at infinity
  fi
enddef;

vardef invert_path(expr P, k) = 
  for t=0 step 1/16 until length P-1/16:
     invert_point(point t of P, k) --
  endfor
  if cycle P:
     cycle
  else:
     invert_point(point infinity of P, k)
  fi
enddef;

beginfig(1);

path C, C'; 
pair P, P', Q; 

k = 150;
draw subpath (-1.4,1.4) of fullcircle scaled 2k withcolor .8[red,white];

C = fullcircle scaled 72 shifted 100 right;
P = point 1 of C;
C' = invert_path(C, k);
P' = invert_point(P, k);
Q = (origin -- P) intersectionpoint subpath (2,4) of C;

draw origin -- P';
draw origin -- center C' withcolor .5 white;
draw P'     -- center C' withcolor .5 white;
draw Q      -- center C  withcolor .5 white;

draw C; 
draw C' withcolor .78 blue; 

fill fullcircle scaled 3;
fill fullcircle scaled 3 shifted P;
fill fullcircle scaled 3 shifted Q;
fill fullcircle scaled 3 shifted P';
fill fullcircle scaled 3 shifted center C;
fill fullcircle scaled 3 shifted center C';

label(btex $O$  etex, origin + (-6,3));
label(btex $P$  etex, P      + (+3,7));
label(btex $P'$ etex, P'     + (-3,7));
label(btex $Q$  etex, Q      + (-3,7));
label(btex $C$  etex, point 5.5 of C + (-3,-7));

endfig;
end

노트

  • 단순화를 위해 invert_point반전 원의 중심이 원점에 있다고 가정합니다. 그러나 반지름 대신 임의의 원을 받아들이도록 서브루틴을 적용하는 것은 어렵지 않습니다 k.

  • path다시 한 번 단순화를 위해 a 와 a에 대해 두 가지 다른 함수를 제공했지만 point단일 invert함수를 쉽게 작성하고 사용 if path P하고 if pair P전달한 내용에 따라 올바른 작업을 선택할 수 있습니다.

  • 표현식은 unitvector p scaled (k/abs(p)) scaled k다음과 같이 더 자연스럽게 작성될 수 있지만 181보다 크게 unitvector p scaled (k**2/abs(p))설정하면 산술 오버플로 오류가 발생합니다. 이는 일반 MP가 허용하는 가장 큰 숫자 보다 크기 때문입니다. 이를 방지하려면 표시된 대로 코드를 작성하거나 처리하는 데 사용하십시오.k182**22**15mpost -numbersytem=double

  • 원점에서 점을 반전시키는 데 이것을 사용하지 마십시오. 유한 다이어그램에서는 무한대를 쉽게 표현할 수 없기 때문입니다.

답변2

나는 Tikz에서 다음과 같은 방법으로 해결했습니다.

첫째, 두 가지 다른 반전이 있습니다.

  1. 점이 반전 원 안에 있습니다.
  2. 요점은 그것 밖에 있다.

두 번째 사례부터 시작하겠습니다. 점 "O"("k"라고 함)를 중심으로 원을 그리고 원 "k" 밖에서 점 "P"의 반전점을 검색합니다.

가장 먼저 알아야 할 것은 "P"에서 "k"까지의 접선점 중 하나입니다. 이 점을 선 "OP"에 투영하는 것이 "P"의 반전점입니다.

\documentclass{article}
\usepackage{tikz}
    \usetikzlibrary{calc}
    \usetikzlibrary{intersections}
    \begin{document}
    \begin{tikzpicture}
        \coordinate (O) at (0,0);
        \coordinate (P) at (5,0);
        \draw[red,thick,name path=circ1](O)circle(2);
        %
        % I look for the midpoint of O and P. This point will be the centre of
        % an arc whose intersection with k will give me the tangent points
        %
        \path(O)--coordinate[midway](M)(P);
        %
        % I draw the arc whose intersection with circle are the 2 tangent points
        %
        \path[name path=circ2] let
            \p1=(O),
            \p2=(M),
            \n1={veclen(\x2-\x1,\y2-\y1)} in
            ($(M)+({\n1*cos(130)},{\n1*sin(130)})$) arc (130:230:\n1);
        \path[name intersections={of=circ1 and circ2}]
            (intersection-1) coordinate (Tg1)
            (intersection-2) coordinate (Tg2);
        \draw[blue]
            (A)--(Tg1)
            (O)--node[midway,left,black]{$\mathtt{r}$}(B)
            (O)--(A);
        %
        % Here we are. This projection is the inversion of point P with regards
        % to circle k
        %
        \draw[orange](Tg1)--($(O)!(Tg1)!(P)$)coordinate(InvP);
        %
        \draw[black,line width=.75,fill=white]
            (P)circle(1.5pt)node[black,below]{$\mathtt{P}$};
        \draw[black,line width=.75,fill=white]
            (O)circle(1.5pt)node[black,below]{$\mathtt{O}$};
        \draw[black,line width=.75,fill=white]
            (Tg1)circle(1.5pt)node[black,below]{$\mathtt{Tg1}$};
        \draw[black,line width=.75,fill=white]
            (InvP)circle(1.5pt)node[black,below]{$\mathtt{P'}$};
        \node at (-1.75,0) {$\symtt{k}$};
    \end{tikzpicture}
\end{document}

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

점이 원 안에 있을 때 우리가 해야 할 일은 OP에서 수직선을 찾고, 이 선과 원 k(TgP라고 함)의 교차점을 찾고, 이 점에서 접선을 그리고 OP와의 교차점을 찾는 것입니다.

관련 정보