Is there an easy way to store the Euclidian distance between two coordinates?
I want to store the value 4 in a macro, so that I can use it to specify the width of a node.
The easiest way I could think of to to this is to somehow store the output of veclen(x,y)
to a macro. I found this line in the tikz-pgf manual
\pgfmathparse{veclen(12,5)} \pgfmathresult
but I can't get it to work.
Does anyone have an idea? I found a couple of answers in this site that have something to do with calculating the distance between coordinates, but they always use the distance inside a specific path and don't store it in a macro to use it later.
Best Answer
Here is a simple (?) code that computes the distance and stores it in a variable.