3
$\begingroup$

How can I know the length of each part of the arrow and what their full length?

points = {{6, 32}, {9, 53}, {18, 42}, {32, 51}};
Graphics[{Arrow[points]}]

enter image description here

$\endgroup$

3 Answers 3

5
$\begingroup$

You can know the length of each part of the arrow and his full length in this way:

distList = 
 EuclideanDistance[points[[# + 1]], points[[#]]] & /@ Range[Length[points] - 1] // N
Plus @@ distList

{21.2132,14.2127,16.6433}

52.0692

$\endgroup$
2
  • 2
    $\begingroup$ Same idea but more concise: EuclideanDistance @@@ Partition[points, 2, 1] $\endgroup$
    – march
    Oct 5, 2016 at 20:18
  • 1
    $\begingroup$ ...and then use Total[] afterwards. $\endgroup$ Oct 5, 2016 at 20:18
8
$\begingroup$

To be concise in a different way:

N@Total@(Norm /@ Differences@points)
$\endgroup$
3
$\begingroup$
N[ArcLength/@Line/@Partition[points,2,1]]

{21.2132, 14.2127, 16.6433}

N@ArcLength[Line[points]]

52.0692

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.