Difference between revisions of "Talk:Parabolic Shot"

From Synfig Studio :: Documentation
Jump to: navigation, search
m
m
 
Line 68: Line 68:
  
 
-- [[User:Dooglus|dooglus]] 15:43, 27 December 2007 (EST)
 
-- [[User:Dooglus|dooglus]] 15:43, 27 December 2007 (EST)
 +
 +
Thank you very much dooglus. --[[User:Genete|Genete]] 18:22, 27 December 2007 (EST)

Latest revision as of 01:22, 28 December 2007

Asking for "Inverse" convert type

I'm trying to implement the equations for a parabolic show with small damping forces (the ones that exists when the projectile is shot in the air)

The equations are those:

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle X(t) = X_0 + \frac {V_{0x}} {b} \left(1- e^{-bt} \right)}

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle Y(t) = Y_0 + \frac {1} {b} \left( \frac {G} {b} + V_{0y} \right) \left( 1-e^{-bt}\right) - \frac {G} {b} t}

Where:

t = the current equation time

b = c/m

c = the damping coefficient

m = the projectile mass

G = the gravity acceleration

and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle V_{0x}} , Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle V_{0y}} , Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle X_0} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle Y_0} are the initial conditions for velocity and position.

If c=0 (no damping forces) the original differential equations are different and its integration gives other equations:

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle X(t)=X_0 + V_{0x}\cdot t}

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://api.formulasearchengine.com/v1/":): {\displaystyle Y(t)=Y_0-\frac{1}{2}\cdot G \cdot t^2 + V_{0y}\cdot t}

Implement in synfig one or other equation is quite easy using the Switch convert type. Other thing is implement the first group of equations.

As well as the parameter b is dividing and multiplying at the same time there are only one possible solutions to implement that with the current synfig convert types possibilities: That the user enter the value of b and the value of 1/b into two separated parameters.

To avoid that I'm asking for a "Inverse" convert type. It should have following sub - parameters:

  • <param> "Link"
  • Real "Zero"
  • Real "Infinite"

Where:

Link is the parameter to be inverted: It can be a Real number only.

Infinite is a very big value that represent a division by a small number smaller or equal to Zero.

Zero is the smaller value that can be inverted. If abs(Link)<=Zero then it returns Infinite. Zero is not allowed to be 0.0. The convert type should limit it to a small value given internally by the code.

Otherwise it returns 1/Link

Would it be possible to implement the "Inverse" convert type? --Genete 10:17, 27 December 2007 (EST)

I've added it, like this:

  • <param> "Link"
  • Real "Epsilon"
  • Real "Infinite"

with this logic:

   if (abs(link) < epsilon)
       if (link < 0)
           return -infinite;
       else
           return infinite;
   else
       return 1.0f / link;

-- dooglus 15:43, 27 December 2007 (EST)

Thank you very much dooglus. --Genete 18:22, 27 December 2007 (EST)