Math.PI

ya did not know much is there a section on snap blocks there

is there a section on snap blocks there

No, up to now the manual has covered only the Snap! environment itself, not the community web site or forum. But maybe it’s time to add that…

If I may make a suggestion, I think there might be other things that might need to get updated first:

Yeah okay no need to be sarcastic, we know that. In particular, I’m acutely aware of having fallen down on the job. We’re working on it. The game plan is to convert the manual to a format that can be saved in pieces in a git repo, which will allow other people to contribute to the manual. This conversion can be done mechanically, and has been (by Michael), but the conversion software only does 90% of the job, which of course means that there’s still 90% of the time still needed to finish it. :~(

I’m sorry, I really wasn’t trying to be.

I fixed it now they are reporters.

Math.PI normal :: reporter

other than one

Math.PI circle :: block


Why not report ((Math.PI :: other) * (2)) ?

ya regarding that you say *2 but that is not the same as plus 3.14
unless you mean why its not a variable then think for a few seconds on why it is not
it was meant to become a library (what I wanted) but don’t think it will happen.

I know that pi+3.14 does not equal pi*2 (which would be pi+pi, not pi+3.14)

but why would you add 3.14, instead of multiplying by two??? As an example, calculating the circumference of a circle is 2 \pi r, not (\pi +3.14)r!

Also, if it’s a library, then you will probably import both all the Math.PI blocks, and (from what I recall, could be wrong) exporting blocks also exports any dependencies (in this case, the Math.PI block)

well there is a block the asks you what you want to multiply by so you can use that.

But that block asks the user for what to multiply, if you always want 2 \pi, you have to trust the user to type in “2” when the “Multiply PI by ___” block is ran. At that point just do ((Math.PI) * (2))

One reason this’ll never be an official library is those ASK blocks. When you started this project, you didn’t understand about user blocks taking inputs; all those command blocks should be one-liner reporters. The reason not to build a user interface into a block that computes a result value is that you want your block to be usable in a composition of functions. For example:

SQUARED #1 can be composed with itself:

untitled script pic (13)

or with some other function:

untitled script pic (15)

But you can’t do either of those things, or anything like them, with SQUARED #2.

Use (() ^ ()), please...

Note that bh’s blocks were an example of how to not use ASK, please…

If I could end the post I would

Ok so I removed the ask blocks and now my thing is useless because it is. So you can stop posting on here.

It’s not useless! Having a Math.PI block is useful, as it lets you do pi things easily without copy pasting the pi value!
I’d recommend you add blocks for calculating the circumference and area of a circle, as those are possibly the most famous uses of pi.

c = 2\pi r
a = \pi r^2

that isn’t the diameter, but the area :slight_smile:

oops :flushed_face:

i’ve fixed that

Who tested the draw a circle. And as for the area of the circle you have to change the Radius. But other than that its ready.
when you use the math.pi normal it does not crash here but on the real website it does.