Jump to content

Global constant for PI


hopbin9

Recommended Posts

Then that begs the question why you were so quick to blame Houdini when it's a trivial RTFM? :)

To see all the global set variables in Houdini in a GUI, just go to the Houdini main menu EDIT > Aliases and Variables... and in the Variables tab, have a look-see for yourself.

Another way to see all the global variables in Houdini is to use the textport commands "set" or "setenv". See the help usage on those two commands to set more if you need to.

Btw you can add hundreds more global variables here.

PI is also clearly defined in all VEX contexts and is accessed with the variable PI.

You can see all the defined variables in $HFS/houdini/vex/math.h

#define M_PI            3.1415926
#define M_PI_2          1.5707963
#define M_PI_4          0.7853981
....

....
    #define PI            M_PI
    #define PI_2        M_PI_2
    #define PI_4        M_PI_4

And defined in Python...

And obviously defined in HDK...

And finally! Everyone should know PI to the first five digits at least. Jeepers this is grade 9 math. I'm depressed...

3.1415

Link to comment
Share on other sites

And finally! Everyone should know PI to the first five digits at least. Jeepers this is grade 9 math. I'm depressed...

3.1415

lol, thanks. I think I was just compared to a grade 9 student.

A long with basic trigonometry, and everything else they told me I'd need later in life. Well, damn them! They were right.

Link to comment
Share on other sites

355/113 is kind of like pi. Just in case you use a software that doesn't actually have a constant for pi. ;)

I voted for your post because of its historical significance. From Wikipedia:

Around 480, the Chinese mathematician Zu Chongzhi demonstrated that π ≈ 355/113 (≈ 3.1415929 ), and showed that 3.1415926 < π < 3.1415927[44] using Liu Hui's algorithm applied to a 12288-gon. This value would remain the most accurate approximation of π available for the next 900 years.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...