Results 1 to 3 of 3

Math Help - Limiting output of a parametric function

  1. #1
    Newbie
    Joined
    Dec 2010
    Posts
    2

    Limiting output of a parametric function

    Hey, all! I hope this is the right thread. (i searched parametric and found several posts in this calc thread)

    I am making a game with some particle effects. The effect in question generates 100 particles at once. Each particle gets a random value we'll call zVel.
    Then their velocity is given a value based on zVel.

    velocity.X = width * (float)Math.Sin(Zvelocity);
    velocity.Y = height * (float)Math.Cos(Zvelocity);

    This all works perfectly. All the variables do what they're supposed to do etc...

    Visually it "plots" particles along the ellipse starting at the Y axis. zVel > 0 goes to the right and up and around. < 0 goes left, up then around.
    The arbitrary limits for zVel are 0 and PI. PI creates a half circle, but the effect is mirrored. (polar I think?)

    So now we have an ellipse that shoots out nicely, but now I need the particles on the bottom to be bigger and as they go around, get smaller.

    For this new function, this means as zVel moves away from zero, the the output (Scale) needs to decrease. Further I need to be able to limit the output by two other variables Min and Max.

    So as zVel approaches -PI or +PI (absolut val of Top), I need the Scale to approach Min and as zVel approaches 0(Bottom), I need zVel to approach Max.

    Here's my code sample that is closest. Obviously there's a potential of dividing by zero, so that's wrong at least.

    top = PI;
    bottom = 0;
    min = 0; //min particle size
    max = 1; //max particle size



    scale *= (PI - max) / (Abs(Zvelocity) + (max/min));


    Any help or explanations on limiting equations would be great!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Dec 2008
    Posts
    319
    Sounds like you want to use

    scale=min+(max-min)|\frac{zVel}{\pi}|.

    This starts as min and approaches max as zVel approaches \pi or -\pi.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2010
    Posts
    2
    Thanks so much for the speedy help!
    It's working great now!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. bound on parametric function
    Posted in the Calculus Forum
    Replies: 2
    Last Post: December 23rd 2011, 07:09 AM
  2. Limits and the Output of a Function
    Posted in the Calculus Forum
    Replies: 1
    Last Post: September 20th 2009, 01:34 PM
  3. What are the Limiting Distribution and Limiting Probabilities
    Posted in the Advanced Statistics Forum
    Replies: 4
    Last Post: April 3rd 2009, 12:49 PM
  4. Moment generating function to deduce limiting distribution
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: February 3rd 2009, 02:47 AM
  5. Formular, matching function input to output
    Posted in the Advanced Algebra Forum
    Replies: 4
    Last Post: March 29th 2008, 08:56 AM

Search Tags


/mathhelpforum @mathhelpforum