How do I can plot a curve in graphic

0 favourites
  • 11 posts
From the Asset Store
All of the graphics you need to make your first Blambo Game!
  • Hello everyone, I want to know how I can make different curves in a form of layout for each function stored in inputbox, it manages different curves such as: f (x) = 1 / x; f (x) = 1 / x ^ 2; f (x) = x ^ 2; f (x) = x ^ 3 f (x) = cos (x); f (x) = sin (x)

  • Do you mean 'How can I graphically represent the output of these curves?' or 'How can I process these strings to turn them into the data points of the right curve?'

    For the former: Lots of tiny sprites.

    For the latter: I've had this problem before and wrote a parser. It was a real pain, and never worked perfectly - if you come across a better solution I'd love to hear it, hence joining this thread. Sorry I couldn't be more helpful!

  • Hello everyone, I'm back here, and got to the graph of a sine function, now I'm having trouble is to fill the empty spaces, I know that with the array can do it, anyone can me help fill these gaps from one point to another.

    My last .capx here:

    https://goo.gl/ahW9Np

  • Quick and dirty way, stretch the sprites from the current point to the next one:

    http://visualparadox.com/dropbox/forump ... e_1.1.capx

    If you want to plot more points you need a math wizard like R0J0hound to help. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";-)" title="Wink">

  • [quote:z9r10gaj]Paradox

    Thank you my friend, you really helped me.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello friends I'm with another entry at this point I believe it is necessary to again another abstraction to fill the empty spaces, can someone tell me how? now to another curve that made the f (x) = x ^ 2 not notice the axis image in discrepancy because for now I could only generate the curve however the exact position as the picture is not all right, thank you for your cooperation.

    The link of my project is below.

    https://goo.gl/ric8jR

  • I dont understand why you want it difficult by not drawing around the (0,0)

    https://www.dropbox.com/s/ptd5o0qy95664 ... .capx?dl=0

    x = the counter, nothing else

    y = the function solved for only that x

    You need to build in a scale-factor, as i did with scaling y.

  • [quote:39jc0z5i]99Instances2Go

    Thank you very much dear friend, helped me a lot, I will study your code, thanks.

  • I'm impressed, you're pretty good.

  • I do not know why but now I found another problem, I changed the resolution to 480 x 640, and now, the curve is also filling in spaces outside of the curve, it will be that this is happening, see this .capx .:

    https://goo.gl/qhB3YL

  • You can not write numbers on the axes, unless they are exact. You cant show math & at same time be mathematical incorrect. Like not done, but you of course do what you like.

    If you want to be mathematical correct, then those curves can not all 'show something interesting' on the same scale.

    If you want to show 'some interesting curve' that is also mathematical correct for all those very different formulas then you need a better scaling. Dont feel like figuring that out myself. Up to you.

    https://www.dropbox.com/s/rv2vwd9rhn0hn ... .capx?dl=0

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)