Given two (A) and (B) 2-D points in tikzpicture environment, I need to collect both angle of the line (A)-(B) with respect to the vector(1,0) and the half of its distance in two variables, say \Aab and \Dab respectively. SOLVED (see Coordinates A, B: compute |B-A| and angle between +x and (B-A))
\documentclass{article}
\usepackage{pgf,tikz}
\usetikzlibrary{calc}
\makeatletter
\newcommand{\getLengthAndAngle}[2]{%
\pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}
{\pgfpointanchor{#2}{center}}
\global\let\myangle\pgfmathresult % we need a global macro
\pgfpointdiff{\pgfpointanchor{#1}{center}}
{\pgfpointanchor{#2}{center}}
\pgf@xa=\pgf@x % no need to use a new dimen
\pgf@ya=\pgf@y
\pgfmathparse{veclen(\pgf@xa,\pgf@ya)/28.45274} % to convert from pt
to cm
\global\let\mylength\pgfmathresult % we need a global macro}
\makeatother
\begin{document}
\begin{tikzpicture}
\clip (0,4) rectangle (7,-5);
\coordinate (A) at (1,1);
\coordinate (B) at (3,4);
\getLengthAndAngle{A}{B}
\draw[help lines,gray] (0,-3) grid (5,5);
\begin{scope}[blue, thick]
\draw (A) -- (B)--+(\mylength,0);
\draw[rotate around={-\myangle:(A)}] (A)--+(\mylength,0);
\end{scope}
\draw (B) circle (\mylength cm);
\end{tikzpicture}
\end{document}

anglelibrary. – Zarko Nov 14 '18 at 20:06angleslibrary that is as you know for drawing an angle symbol between two lines, the OP wants to calculate an angle and a distance. – Torbjørn T. Nov 14 '18 at 20:16\documentclassand the appropriate packages that at least sets up the problem.While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. This will also serve as a test case and ensure that the solution actually works for you. As it is it is not clear what you mean by "collect".
– Peter Grill Nov 14 '18 at 20:23angles. it seems that i misunderstood the question. – Zarko Nov 14 '18 at 20:33}afterwe need a global macroto a new line, your code compiles. And you are loading calc, so I do not inevitably see a reason for all the gymnastics. You could just do\drawlet \p1=($(B)-(A)$), \n1={atan2(\y1,\x1)}, \n2={veclen(\y1,\x1)} in [rotate around={-\n1:(A)}] (A)--+(\n2,0);to have angle and the length in\n1and\n2, respectively. That is, this line reproduces your result without the need of these macros. – Nov 14 '18 at 21:47