Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorXyuzhg (Moderator)
    • CommentTimeApr 2nd 2015 edited
     
    This is a complete rewrite of this here: http://forum.colorinfection.com/comm...
    Once again, I have written this function with the goal of increasing performance and utility.
    Here's a direct comparison of how much better this new function is:

    It's also a smaller function: 4095 vs. 5811 bytes. Clean import version:

    Here's my old grapher with my new function instead for you to play with (also edited slightly to load new values on the fly, as the function is now powerful enough):

    To use the function, first take a string with your math expression, simply put it into the CompileExpression function, and keep the output. If you want to now set your variables, just use the SetVariable function (note that as of yet, only single-character alphabetic variable names are supported). Once you have set your values, simply call EvaluateExpression to obtain the result.

    Some notable features include an expanded recognized functions list, n-ary functions, boolean operators, increased stability (whitespaces are fine!) and a highly programmable implementation method (adding a new function is extremely easy). I plan to eventually add the absolute value signs |x| as an alternative to the abs() function, the conditional operator b ? x : y, and eventually, basic optimization with constants (so x+2*4 automatically resolves to x+8 without need for further calculation).

    Documentation here: https://docs.google.com/spreadsheets...
    I have not ironed out every problem as of yet, and nor have I included every function I want to add. Feedback/suggestions are very welcome.-----------------
    Hopefully PA is inconsistent.
    •  
      CommentAuthorBioManiac R2 (Moderator)
    • CommentTimeApr 2nd 2015
     
    hmm..... sin(x)^x seems to break it :P how do I increase/decrease the sample rate? the lines looks so choppy idk how to make them smoother D:
    • CommentAuthorXyuzhg (Moderator)
    • CommentTimeApr 2nd 2015 edited
     

    (url)

    To change the resolution, select the function and click the options button on the upper right.

    I've also went and changed the default resolution to 200, because I forgot to originally. :P-----------------
    Hopefully PA is inconsistent.
    •  
      CommentAuthorMathdude314 (Advanced Member)
    • CommentTimeApr 2nd 2015
     
    You use a Mac?-----------------
    If less people are active, that will only make for even less activity. Start making those designs!
    Currently working on a one-round no-elimination quick RP game...
    •  
      CommentAuthorBioManiac R2 (Moderator)
    • CommentTimeApr 2nd 2015
     
    lol that isn't what it looked like when I put it in Xyuzhg! It was like - weird lines on a 1/2x slope that filled the bottom right of the screen xD

    looks much smoother now :)
    • CommentAuthorXyuzhg (Moderator)
    • CommentTimeApr 4th 2015 edited
     
    Some minor edits.

    - Expressions like xxx now work properly (there was an issue with the regex replacement)
    - Some changes have been made to the precedence of some cases of implicit multiplication: 2x^3y still is (2x)^(3x), but sinx cosy is now sinx * cosy.
    - Implicit multiplication now uses the standard multiplication key, allowing for some less confusing code.
    - The grapher now has a default resolution of 500.

    I'm making more solid plans with the conditional operator at the moment.-----------------
    Hopefully PA is inconsistent.
    •  
      CommentAuthorMathdude314 (Advanced Member)
    • CommentTimeApr 4th 2015
     
    I believe 1/(x-1.4821) will draw a "vertical asymptote" on [-5, 5]. Reason: Caclulates points, -5, -4.996, -4.992, ..., 1.480 (high positive), 1.484 (large negative) and draw the line from (1.48, ~-500) to (1.484, ~500).

    Unless the dots are not connected.-----------------
    If less people are active, that will only make for even less activity. Start making those designs!
    Currently working on a one-round no-elimination quick RP game...
    •  
      CommentAuthorMathdude314 (Advanced Member)
    • CommentTimeApr 4th 2015 edited
     

    (url)



    (url)
    -----------------
    If less people are active, that will only make for even less activity. Start making those designs!
    Currently working on a one-round no-elimination quick RP game...
    •  
      CommentAuthorMathdude314 (Advanced Member)
    • CommentTimeApr 4th 2015 edited
     
    Feature Requests
    • Coloring graphs
    • Use the "Editable" property of text shapes
    • Increase thickness of selected graph to make it "stand out"
    • Nonconnected mode-----------------
    If less people are active, that will only make for even less activity. Start making those designs!
    Currently working on a one-round no-elimination quick RP game...
    • CommentAuthorXyuzhg (Moderator)
    • CommentTimeApr 4th 2015
     
    I've added an API for numerical integration!
    It should be able to handle anything you throw at it, provided that the integral converges.
    There's support for varied precision goals and recursion depth. But it looks like you can compute at least to 1e-9 precision with not even a hiccup, so it might not be necessary.

    To address Mathdude314:
    • Colored graphs are already supported. Just look in the options.
    • I made the grapher three years ago, but I can certainly work on converting it to editable. Or remake the grapher completely.
    • Nonconnected mode: If I remake the grapher, I could probably throw in detection of large discontinuities, or varied precision depending on the change between two values.-----------------
    Hopefully PA is inconsistent.