Grasshopper

algorithmic modeling for Rhino

Hi all,

 

Any way to map a domain into another domain (as an older post) but without VB?

 

Well exctly what i want is to transform a list of n elements into another with same n elements but different domain, {17.9 to 53.4} to {0 to 1} in this case.

 

I want the proportional values between elements from one domain to the other..

 

Each element is just one number

 

Cheers!!

Views: 506

Replies to This Discussion

certainly.
first get the extremes of your start domain. next take your list of n elements and run it through the following equation (x being each item in the list).

(x - min) / (max-min)
Hi David,

Thanks!! Works perfect!

I finally used your expression but in VB in this way

y=(x-t)/(u-t) where t and u where max and min from starting domain and y as output

Cheers!!
david's suggestion works great, just watch out that you don't call your function variables "min" and "max" because these are reserved keywords for specific functions. Also, GH 0.7 has a built-in component for exactly this purpose.
Thanks!! Works perfect!

I finally used your expression but in VB in this way

y=(x-t)/(u-t) where t and u where max and min from starting domain and y as output

Cheers!!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service