我有以下 MWE。我正在尝试计算蓝线上端的坐标,最初由 +(45:2) 确定,并将该坐标分配给点 B。不知道该怎么做...
\documentclass{standalone}
\usepackage[usenames,dvipsnames,svgnames,table,x11names]{xcolor}
\usepackage{tikz}
\usetikzlibrary{angles,arrows,calc,chains,intersections,through,backgrounds,patterns,positioning,quotes,decorations}
\begin{document}
\begin{tikzpicture}
\coordinate (ORG) at (0.00, 0.00);
\fill[red] (ORG) circle (2pt) node[above left] {O};
\coordinate (A) at (1.00, 2.00);
\fill[red] (A) circle (2pt) node[above left] {A};
\draw[blue, line width=1.50pt] (A) -- +(45:2);
\coordinate (B) at (45:4); %+(45:2)
\fill[magenta] (B) circle (3pt);
\fill[magenta] (B) circle (3pt) node[above right] {B};
\end{tikzpicture}
\end{document}
答案1
这是一个解决方案
\documentclass{standalone}
\usepackage[usenames,dvipsnames,svgnames,table,x11names]{xcolor}
\usepackage{tikz}
\usetikzlibrary{angles,arrows,calc,chains,intersections,through,backgrounds,patterns,positioning,quotes,decorations}
\begin{document}
\begin{tikzpicture}
\coordinate (ORG) at (0.00, 0.00);
\fill[red] (ORG) circle (2pt) node[above left] {O};
\coordinate (A) at (1.00, 2.00);
\fill[red] (A) circle (2pt) node[above left] {A};
\draw[blue, line width=1.50pt] (A) -- +(45:2)coordinate(B);
\fill[magenta] (B) circle (3pt);
\fill[magenta] (B) circle (3pt) node[above right] {B};
\end{tikzpicture}
\end{document}