+ Reply to Thread
Results 1 to 5 of 5

Thread: Need ADVANCED help with functions!

  1. #1
    Wire Noob scasbyte's Avatar
    Join Date
    Jul 2007
    Posts
    7

    Default

    Hi again! I'm Scasbyte...

    I need help!. I'm making a racing car with smooth acceleration, however I would like to use a function to get the speed, instead of a Value Smoother, the function is this:

    [attachment=828:function3.jpeg]

    X is time, and Y is speed, but there is a big problem!!!, the function is just too complex to calculate, ¿What can I do? ¿Are there easier functions that describe the same movement?

    Thanks!!!
    Attached Thumbnails Attached Thumbnails Need ADVANCED help with functions!-function3.jpeg  

  2. #2
    Wire Noob scasbyte's Avatar
    Join Date
    Jul 2007
    Posts
    7

    Default

    Sorry, I forgot to put the function in the last post...

    The function is this: sin(x) + differential(sin(x^2))

    It is not too complex actually... but it may take too many seconds for an Expression Gate to calculate it...

  3. #3
    Wire Amateur ChrischriS's Avatar
    Join Date
    Apr 2007
    Posts
    51

    Default

    Actually I'm pretty sure it won't take more than a second to calculate...

    It might not be TOO complex for the Expression chip but it sure is to me.


    Try it out, although I don't understand what is it to make it go...


    Hey! Do you want to try it with me?
    The complex is almost always better.

  4. #4
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    You can approximate the curve which should be good enough for your needs and then just use it instead.
    (You can probably use the equation you have there too, by simply approximating the differential)

  5. #5
    Wire Noob Falados's Avatar
    Join Date
    Jun 2007
    Location
    United States of America
    Posts
    20

    Default

    Hi again! I'm Scasbyte...

    I need help!. I'm making a racing car with smooth acceleration, however I would like to use a function to get the speed, instead of a Value Smoother, the function is this:

    [attachment=828:function3.jpeg]

    X is time, and Y is speed, but there is a big problem!!!, the function is just too complex to calculate, ¿What can I do? ¿Are there easier functions that describe the same movement?

    Thanks!!![/b]
    Use a few iterations of a Maclaurin series:

    two or three terms should do just fine.

    Maclaurin series, sin(x) = x - x^3/(3!) + x^5/(5!) - x^7/(7!) ...

    EDIT: Sorry, I was wrong about the estimate the first time,
    Use THIS: 2+x-1/6*x^3-x^4+1/120*x^5

    it fits so nicely over the range you need.

+ Reply to Thread

Similar Threads

  1. NPC functions - Egate2
    By Bobsymalone in forum Wiremod Addons & Coding
    Replies: 50
    Last Post: 10-30-2009, 09:15 AM
  2. E2 seat functions!
    By Azrael in forum Wiremod Addons & Coding
    Replies: 18
    Last Post: 05-09-2009, 12:14 AM
  3. [E2] HUD-drawing functions
    By SatansSimon in forum Wiremod Addons & Coding
    Replies: 23
    Last Post: 03-22-2009, 03:15 PM
  4. E-2 some functions.
    By Whodunnit in forum Ideas & Suggestions
    Replies: 12
    Last Post: 03-11-2009, 05:31 AM
  5. E2: Few new functions
    By d3cr1pt0r in forum Wiremod Addons & Coding
    Replies: 24
    Last Post: 02-22-2009, 10:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots