Vectors primitives like normalization, length, projection.
So that it's easier to do interactive geometric constructions and games.
A project with naïve implementation is available here: https://snap.berkeley.edu/project?username=programaths&projectname=vectors
Note that it understand when a sprite is passed on and convert it into a point (list with two elements). The "vector" blocks create a vector from two points (B-A).
Also, the project use the built in hyperoperators, but it may be worth to have blocks for vector operations.
Since vectors are very easy to code yourself, they are likely not going to be added as primitives, they'd be added as a library.
If you understand how to code vectors, why don't you create your own vector library and share it on the forum?
Because forum is less discoverable than one click library.
Also, it is probably slower using blocks than native.
You can see it by how you responded to me sharing a project including the blocks on the forum, it's so tedious you didn't even open the project. And I can understand it, that's why I am proposing to have them as primitives (for performance) or library (for convenience).
I also don't like to make them in JS since that requires checking the "enable javascript extention" or something like that.
Sorry, I didn't open it because I'm on my phone, and snap on a phone is not very easy to use. If I was on my computer, I would.
Not really, as math blocks (and hyperblocks) already run instantly. The performance boost that javascript would give is so miniscule that it's unnoticeable.
I will try to share the exported blocks somewhere in the forum, but I don't think I can attach files as I can't even upload pictures.
I posted on the forum and now I am further restricted and cans post links. But you can probably find the post by searching "vector".
That's sad I can't post the picture, but I think my "documentation" and the project itself is good enough to be able to use the library.
I've bumped your trust level up, so you should be able to post images and multiple links. I'm not sure of you know this, but you can drag and drop script pics from the forum into snap to get the blocks back (to create a script oic, right click a script, and click "script pic").
Thanks you very much for both things.
I didn't knew you can drag and drop from forum to snap.
So, to provide the library, I would export pics of each block or I just add the link to the project ?
Updated the post at this location: Vector block
You can do both. Having the script pics allow people to see the blocks without opening snap. You can actually also right click the scripting area (not on a script) and click "scripts pic" to get a picture of all the scripts in the sprite (though I'm pretty sure when you drag and drop it into snap, it gives you the sprite instead of just the blocks).
It seems to only export the "main" script (what is visible on screen) and ignores the content of custom blocks. (And those blocks are "global" -- defined for all sprites)
Thanks for your support. I hope it will help people.
I'm an admin, so yes, but you can't.