Message Boards Message Boards

0
|
4480 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Finding length of random scribbles?

Posted 8 years ago

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

POSTED BY: Balazs Aczel
3 Replies
Posted 8 years ago

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

POSTED BY: Balazs Aczel

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.
POSTED BY: Sean Clarke

Hi,

please try

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

Cheers,

M.

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract