PI

sono's icon

Hello,

What's the symbol for pi to use it in the [expr] object?

Thanks,
Poul

Wesley Smith's icon

Yes that's a real website.
wes

On 10/4/06, poul wrote:
>
> Hello,
>
> What's the symbol for pi to use it in the [expr] object?
>
> Thanks,
> Poul
>

Roman Thilenius's icon

maxobjects.com will bring up some externals which can
output pi - if you need it more accurate than possible
with 32 bit (which i doubt for expr.)

then you can use a variable (f$1) in your expr and feed
it the number.

Jesse's icon

I'm not sure what you're doing with expr, but it's probably a lot easier to use the js object for this. That way you can access the Javascript constant Math.PI in your expression.

Stefan Tiedje's icon

Jesse Gilbert wrote:
> I'm not sure what you're doing with expr, but it's probably a lot
> easier to use the js object for this. That way you can access the
> Javascript constant Math.PI in your expression.

This is only true if you are as fluid in javascript as in Max -
wait, its obviously not true:
Math.PI will eat up 7 characters, 3.141593 will eat 8, but as you need
some other lines of code in js, you need a lot more characters. If you
use my "pi" abhaXion, you need only 2 plus one patch chord... ;-)

save as pi:

Max Patch
Copy patch and select New From Clipboard in Max.

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Jean-Francois Charles's icon
Peter Castine's icon

expr's interface to the outside world is 32-bit floats (and integers). So 3.141593 is as close as you're gonna get anyway.

For that you need a symbolic constant?

nick rothwell | project cassiel's icon

On 7 Oct 2006, at 02:59, Peter Castine wrote:

> expr's interface to the outside world is 32-bit floats (and
> integers). So 3.141593 is as close as you're gonna get anyway.

[expr 22. / 7.] should be good enough for anybody.

Actually, [expr 355. / 113.] looks to be as close as makes no odds in
the 32-bit world.

    -- N.

nick rothwell -- composition, systems, performance -- http://
www.cassiel.com

sono's icon

thanks for all your replies.

i'm not into the js object, yet..
i'll just use the value inside expr. though it would be easier if there existed a symbol for it. like "p" for instance. maybe there's a good reason for not using this?

Michael's icon

also:

[expr acos (-1.)]

but still puts out only 3.141593

so just ignore me :)

-mb

Nick Rothwell wrote:
>
> On 7 Oct 2006, at 02:59, Peter Castine wrote:
>
>> expr's interface to the outside world is 32-bit floats (and
>> integers). So 3.141593 is as close as you're gonna get anyway.
>
> [expr 22. / 7.] should be good enough for anybody.
>
> Actually, [expr 355. / 113.] looks to be as close as makes no odds in
> the 32-bit world.
>
> -- N.
>
>
> nick rothwell -- composition, systems, performance --
> http://www.cassiel.com
>
>
>
>

Nicolas's icon

Inside gen~ there is a 'pi' object. Connect it to out of gen~, connect gen~ to snapshot~, connect snaphot~ to expr ; )

Christopher Dobrian's icon

You could use maxurl to Google "circumference of the sun", and then... :)

But seriously, what Peter Castine said.

Mr.NiceGuy's icon

ah. found it;-) http://3.141592653589793238462643383279502884197169399375105820974944592.com/index314159.html

Joe X Med O''s icon

I found 2 ways of obtaining pi value:
sending a bang to object "acos" with value "-1":
[acos -1]
using "acos" in expr:
[expr acos(-1)]
the same can be used with "e" value using "exp(1)" in "expr" object...

Roman Thilenius's icon


in disregard of what everyone said 14 years ago - including me - of course INSIDE [expr] you can gain a lot of extra accuracy in 32 bit (-data) max when you either calculate it using acos(), asin() or use at least 11 digits.