How can I write an expression like r = sqrt(A/pi) on grasshopper?

I don’t get it,
can someone write me a simple script like r = sqrt(A/pi) in either ghpython or evaluate/expression?

I know a little bit of python, but I’m not even sure where to start with the grasshopper/rhino integration



You’ll only need to know very basic Python to be able to do the math, so you’re probably good there. Here’s a couple screen clips of it in C# (I don’t know python):

The script will more or less be setup for you, you just type your code:
Not that you asked but one thing that really hung me up was that you have to zoom really close to see these “+” and “-” symbols, that’s how you add/delete in/out parameters.

Another thing that gets lots of people is that they have to right-click and select the correct “type hint”. In this case, your ‘r’ will simply be a double.

I figured what the hay and tried to set up the python module as well. I stumbled upon this PDF link: (8.5 KB)

1 Like