用tikz画两条线然后取两条线交点坐标
可以使用TikZ中的“intersection”库来实现。下面是一个简单的示例代码:
\begin{tikzpicture} % 画两条线 \draw (0,0) -- (2,2); \draw (0,2) -- (2,0);
% 获取交点坐标 \path[name intersections={of=line1 and line2, by=point}];
% 在交点处标记一个圆点 \filldraw[black] (point) circle (2pt); \end{tikzpicture}
在这个示例中,我们首先画了两条线,然后使用“intersection”库中的“name intersections”命令获取它们的交点坐标,并将其命名为“point”。最后,我们在交点处标记了一个圆点。
原文地址: https://www.cveoy.top/t/topic/m1p 著作权归作者所有。请勿转载和采集!