# Extension request - Equations and Paths

**URL:** <https://forum.makecode.com/t/extension-request-equations-and-paths/31407>\
**Category:** Arcade\
**Tags:** graphics-and-math, make, extension\
**Created:** [October 30, 2024, 4:36pm UTC](https://forum.makecode.com/t/extension-request-equations-and-paths/31407 "2024-10-30T16:36:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jquinn](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jquinn](https://forum.makecode.com/u/jquinn)\
**Post date:** [October 30, 2024, 4:36pm UTC](https://forum.makecode.com/t/extension-request-equations-and-paths/31407/1 "2024-10-30T16:36:40Z")

</div>

I am a middle school engineering teacher and love the arcade. It is so useful and has a lot of connections that can be made to math, but one big thing missing is the ability to create equations and use iterations. Maybe I don’t know enough about coding but all Sprite motion is controlled by vx and vy variables. With the right combination of code you can create unique movement patterns but it would be awesome if there was a block of code that said:

set (mysprite) (IMAGE) path to (allow an equation to be entered) with velocity of (NUMBER)  
and  
set (projectile) to projectile (IMAGE) from (mysprite) with path (EQUATION) velocity of (NUMBER)

I am not sure how possible that is, and I am definitely not informed enough to do it on my own. Man I could connect to Algebra, Algebra 2 and geometry standards all day long. You would become an educational hero.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 30, 2024, 5:59pm UTC](https://forum.makecode.com/t/extension-request-equations-and-paths/31407/2 "2024-10-30T17:59:08Z")

</div>

Parsing equations is definitely worth an extension, but I don’t think you really need it. Instead of messing around with `vx` and `vy`, (unless you want to use derivatives) you can directly set the X and Y values of a sprite. I had a little fun making this pseudo graphing calculator:

> **[equation as path](https://arcade.makecode.com/37840-08697-73310-83507)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

You define your math function in the code itself and the sprite follows the path. You can set the `window{X,Y}{Min,Max}` and `graphSteps` variables to your liking.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 30, 2024, 7:49pm UTC](https://forum.makecode.com/t/extension-request-equations-and-paths/31407/3 "2024-10-30T19:49:03Z")

</div>

(I decided to extend the path grapher to a budget graphing calculator. It kinda dies when there is undefined behavior or to +/- inf because I didn’t put in any checks for that kinda stuff. Thats why it looks weird in the preview below for tan(x))

> **[budget graphing calculator](https://arcade.makecode.com/38101-51802-35638-52229)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [October 30, 2024, 7:54pm UTC](https://forum.makecode.com/t/extension-request-equations-and-paths/31407/4 "2024-10-30T19:54:53Z")

</div>

Iterations are pretty easy to implement! Instead of defining the whole equation, just run your code in a Forever loop! You can determine the next step based on where the sprite is currently and that’s iteration!
