\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\tikzset{
plotmark/.style = {%
solid, fill = black, circle, inner sep = 0pt, minimum size = 4pt
},
}
\begin{tikzpicture}
\coordinate (O) at (0, 0);
\coordinate (A) at (0, 3);
\coordinate (G) at (1, 0);
\node[circle, minimum size=6cm, draw=darkgray] (C) at (O) {};
\node[plotmark, label={below left:$O$}] at (C.center){};
\node[plotmark, label={above:$A$}] at (A){};
\node[plotmark, red] at (G){};
\end{tikzpicture}
\end{document}
假设 G(红点)为重心,物体悬挂在固定点 A 处并可自由旋转。如果不进行手动计算,我如何(如果可能)旋转物体,使点 G 垂直位于点 A 下方?
以下是我想要实现的一个示例。假设我有:
假设物体悬挂在点 F 处,假设点 B 为重心。在现实生活中,物体将处于:
答案1
你可以这样做元帖子。这可能会为您提供 TikZ 解决方案的起点。
\RequirePackage{luatex85}
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
pair A, C, O;
O = origin;
A = 100 up;
C = (42,-13);
path c; c = fullcircle scaled 2 abs(A) shifted O;
picture p[];
p1 = image(
draw c;
drawdot O withpen pencircle scaled dotlabeldiam;
drawdot A withpen pencircle scaled dotlabeldiam;
drawdot C withpen pencircle scaled 5/4 dotlabeldiam withcolor 2/3 red;
);
p2 = p1 rotatedabout(A, -90-angle(C-A));
draw p1 withcolor 3/4 white;
draw p2;
endfig;
\end{mplibcode}
\end{document}