Finding length of random scribbles?

Hello All,

Surely, it is an entry-level question, but all I wish to know is how to tell the Euclidean distance of a random scribble (the total length of all the lines), such as one generated by

Graphics[Line[RandomReal[1,{30,2}]]]

Many thanks,
Balazs

Hi,

please try

ArcLength@Line[RandomReal[1, {30, 2}]]

Cheers,

M.

You can use the ArcLength function:

ArcLength[Line[RandomReal[1, {30, 2}]]]

But unfortunately, that doesn’t really teach anything about programming. If you want to learn more, you should try:

  • Writing a function that finds the length of a single line.
  • Writing a function that finds the length of a list of lines.

Thank you very much, it helped!
Cheers,
B.