Function Plotter

  • Something went in my mind after seeing OldPalHappy's Equation Solver.
    I was wondering if I could make a function plotter on a GUI just like our calculators does.
    After some work, I got it to work ! You can check the place here and feel free to download the place and change the function by changing the last line in the drawer script located in game.StarterGui.ScreenGui.Frame.Drawer

    Here are 2 examples

    But there are limitations with what I did:

    • Can only see values (x and y) between -10 and 10 (with some tweaking, we can make it customable)
    • For functions with a high variation between 2 computed y values (like 1/x when x is close to 0), it won't draw very well (as you can see in the homographic function picture). We can make this better by reducing the 3rd value of the for loop, but it will take longer to display and eventually crash if it's way too low. We can also compute the difference between these points and see if it's needed to draw more.
    • The y value is computed using loadstring in a local script, so if you try to draw a function in play mode, it won't work since loadstring can't be used on a client. So you'll have to use a RemoteEvent or whatever to ask the server to compute everything.

  • @homermafia1 Ohhhh. This is so neat!

Log in to reply

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.