
나는 아래에 있는 내용을 따라 다이어그램을 만들려고 합니다.
- x와 y의 중심을 갖는 2개의 교차하는 구
- 중간점은 (x+y)/2이고 중심에서 중간점까지는 d/2입니다.
- 중심에서 교차점까지의 거리는 r입니다.
나는 두 구의 모든 교차점은 중점을 연결하는 선에 수직인 평면 위에 있고, 평면은 중점을 통과하며, 두 구의 모든 교차점은 원을 만든다는 것을 보여주고 싶습니다.
이제 실제로 2D로 만들면 어느 정도 만들 수 있지만(페인트를 사용하지 않고 tikz를 사용함) 너무 복잡해 보이지 않고 3D로 만들 수 있는지 궁금합니다.
지금까지 Schrodinger's Cat의 도움으로 이것을 얻었습니다(하지만 이것은 제가 만들려고 시도한 첫 번째 3D Tikz이므로 계속 작업할 것입니다).
\documentclass[tikz,border=3mm]{standalone} \usepackage{tikz-3dplot-circleofsphere}
\begin{document}
\tdplotsetmaincoords{70}{200}
\begin{tikzpicture}[tdplot_main_coords,declare function={d=4;R=2.5;}]
\path (0,0,0) coordinate (x) (d,0,0) coordinate (y);
\begin{scope}[tdplot_screen_coords]
\path[ball color=blue,opacity=0.3] (x) circle[radius=R*1cm];
\path[ball color=blue,opacity=1.0] (x) circle[radius=R*0.02cm];
\path[ball color=red,opacity=0.3] (y) circle[radius=R*1cm];
\path[ball color=red,opacity=1.0] (y) circle[radius=R*0.02cm];
\node(draw) at (0.5,0,0) {y};
\node(draw) at (-4.2,0.5,0) {x};
\node(draw) at (-1.8,2,0) {z};
\draw[black, ultra thick] (x) -- (y);
\draw[blue, ultra thick] (x) -- (-1.7,1.7);
\draw[red, ultra thick] (y) -- (-1.7,1.7);
\end{scope}
\tdplotCsDrawCircle[tdplotCsFront/.style={thick}]{R}{0}{90}{90-atan2(sqrt(R*R-d*d/4),d/2)}
\end{tikzpicture}
\end{document}
답변1
이것은 귀하가 추가한 것과 유사한 몇 가지 추가 재료를 포함하여 제가 작성한 설명입니다. 이 코드는 tikz-3dplot-circleofsphere
찾을 수 있는 에 의존합니다.여기.
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot-circleofsphere}
\begin{document}
\tdplotsetmaincoords{70}{200}
\begin{tikzpicture}[tdplot_main_coords,declare function={d=4;R=2.5;}]
\path (0,0,0) coordinate[label=right:$x$] (x)
(d,0,0) coordinate[label=left:$y$] (y)
(d/2,0,{sqrt(R*R-d*d/4)}) coordinate[label=above:$z$] (z);
\draw[black, ultra thick] (y) -- (d/2,0,0);
\draw[red, ultra thick] (y) -- (z);
\tdplotCsDrawCircle[tdplotCsFront/.style={draw=none,fill=gray,fill opacity=0.7},
tdplotCsBack/.style={thin,gray,fill=gray,fill opacity=0.7}]{R}{0}{90}{90-atan2(sqrt(R*R-d*d/4),d/2)}
\draw[black, ultra thick] (x) -- (d/2,0,0);
\draw[blue, ultra thick] (x) -- (z);
\fill foreach \X in {x,y,z} {(\X) circle[radius=1.2pt]};
\begin{scope}[tdplot_screen_coords]
\path[ball color=blue,opacity=0.6] (x) circle[radius=R*1cm];
\path[ball color=red,opacity=0.6] (y) circle[radius=R*1cm];
\end{scope}
\tdplotCsDrawCircle[tdplotCsFront/.style={thick},
tdplotCsBack/.style={draw=none}]{R}{0}{90}{90-atan2(sqrt(R*R-d*d/4),d/2)}
\end{tikzpicture}
\end{document}
답변2
이것은 대답이 아닙니다. 나는 원을 그리는 방법이 두 구의 교차점을 기반으로 한다는 것을 보여주고 싶습니다.여기에 대답하세요.
나는 방정식이 있는 두 개의 구체를 선택 (x - 3)^2 + (y + 4)^2 + z^2 = 64
하고 (x - 3)^2 + (y - 2)^2 + (z - 8)^2 = 36
. 내 코드
\documentclass[tikz,border=2mm, 12 pt]{standalone}
\usepackage{tikz-3dplot-circleofsphere}
\usetikzlibrary{3dtools}
\begin{document}
\tdplotsetmaincoords{70}{100}
\begin{tikzpicture}[scale=1,tdplot_main_coords,declare function={R=8;R1=6;
}]
\path (3,-4,8) coordinate (A)
({(9-sqrt(95))/3},8/3,3) coordinate (B)
({(9+sqrt(95))/3},8/3,3) coordinate (C)
(3,2,8) coordinate (T)
(3,-4,0) coordinate (I);
\begin{scope}[tdplot_screen_coords]
\fill[ball color=red,opacity=0.6] (I) circle (R);
\fill[ball color=green!50, opacity=1.0] (T) circle (R1);
\end{scope}
\foreach \p in {A,B,C,I,T}
\draw[fill=black] (\p) circle (1.5pt);
\foreach \p/\g in {A/90,C/-90,B/-90,I/-90,T/90}
\path (\p)+(\g:3mm) node{$\p$};
\pic[draw=none]{3d circle through 3 points={A={(A)},B={(B)},C={(C)}}};
\begin{scope}[shift={(T)}]
\path[overlay] [3d coordinate={(myn)=(A)-(B)x(A)-(C)},
3d coordinate={(A-M)=(A)-(M)}];
\pgfmathsetmacro{\myaxisangles}{axisangles("(myn)")}
\pgfmathsetmacro{\myalpha}{{\myaxisangles}[0]}
\pgfmathsetmacro{\mybeta}{{\myaxisangles}[1]}
\pgfmathsetmacro{\mygamma}{acos(sqrt(TD("(A-M)o(A-M)"))/R1)}
\tdplotCsDrawCircle[tdplotCsFront/.style={thick,red}]{R1}{\myalpha}{\mybeta}{\mygamma}
\end{scope}
\end{tikzpicture}
\end{document}
답변3
다음은 2개의 반경이 다를 수 있는 일반적인 경우에 대한 솔루션입니다. 먼저 평면 그림과 같이 계산합니다.
// http://asymptote.ualberta.ca/
usepackage("ragged2e"); // for justify command
usepackage("amsmath");
unitsize(7mm);
real r=4.2, s=3; // two radii
real c=5; // distance of two centers
pair A=(0,0), B=c*dir(0); //two centers
pair M=intersectionpoints(circle(A,r),circle(B,s))[0];
real dAH=(c^2+r^2-s^2)/(2*c);
real h=sqrt(r^2-dAH^2);
pair H=A+dAH*unit(B-A);
draw(Label("$h$",align=W),M--H,magenta);
draw(Label("$r$",align=NW),A--M,red);
draw(Label("$s$",align=NE),B--M,blue);
draw(circle(A,r),red);
draw(circle(B,s),blue);
dot(H^^M,magenta);
dot("$A$",A,SW);
dot("$B$",B,SE);
label("$M$",M+.5dir(80),magenta);
label("$H$",H,S,magenta);
draw(Label("$c$"),A--B);
string explanation=minipage("\justify{
By the law of cosines for the triangle $AMH$, we have
$$AH=r \cos A=\dfrac{c^2+r^2-s^2}{2c}.$$
Hence, the radius of the intersecting circle is
$$h=\sqrt{r^2-AH^2}.$$
}",7cm);
label(explanation,point(E)+(6,0),Fill(3mm,lightyellow));
shipout(bbox(5mm,invisible));
이제 모든 것이 3D로 변환됩니다.https://tex.stackexchange.com/a/121900/140722. 모듈은 graph3
교차하는 원의 정확도를 높이기 위한 것입니다 Circle(H,h,normal=B-A)
.
// http://asymptote.ualberta.ca/
unitsize(1cm);
//import math;
//import three;
import graph3; // implicitly import math and three;
real r=3.5, s=4; // two radii
real c=5; // distance of two centers
triple A=(0,0,0), B=c*dir(90,90); //two centers
surface sphAr=shift(A)*scale3(r)*unitsphere;
surface sphBs=shift(B)*scale3(s)*unitsphere;
draw(sphAr,red+opacity(.2));
draw(sphBs,blue+opacity(.2));
real dAH=(c^2+r^2-s^2)/(2*c);
real h=sqrt(r^2-dAH^2);
triple H=A+dAH*unit(B-A);
draw(Circle(H,h,normal=B-A),magenta+1pt);
dot(H,magenta);
dot("$A$",A,W);
dot("$B$",B);
draw(A--B);
//axes3("$x$","$y$","$z$");