Grasshopper

algorithmic modeling for Rhino

If I have a list with 100 numbers ... How can I for example filter out the largest number AND it's index in the list? or the smallest and it's index? ...

Views: 517

Replies to This Discussion

You can sort the number while sorting the indices synchronously. Then the first value in the sorted indices list will be the index of the lowest number and the last value the index of the highest number. If there are multiple lowest or highest values (like the in the image below) the final order of the indices is unpredictable. It might be 12 and then 9 but it just as easily have been 9 and then 12.

--

David Rutten

david@mcneel.com

Tirol, Austria

This is another approach. Caveat in this case is that you need to convert your domain values back to integers if your original numbers were also integers.

--

David Rutten

david@mcneel.com

Tirol, Austria

how is the component "min max" called?

ok, bounds

"Bounds". It's in Maths tab, Domain panel.

--

David Rutten

david@mcneel.com

Tirol, Austria

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service