Provide additional information on the grammar and semantics for tav element’s fmla attribute
Provide this information.
Part 4, 4.6.79
te
Proposed Disposition of DIS 29500 Comment ECMA-0067 (Modified: 2008-01-09) Agreed; this should be more thoroughly documented. The following changes will be made to Part 4, ยง4.6.79, page 3,147, line 1: Attributes Description fmla (Formula) This attribute allows for the specification of a formula to be used for describing a complex motion for an animated object. The formula manipulates the motion of the object by modifying a property of the object over a specified period of time. Each formula has zero or more inputs specified by the ($) symbol, zero or more variables specified by the (#) symbol pre-pended to the variable name and a target variable which is specified by the previously specified attrName element. The formula may contain one or more of any of the constants, operators or functions listed below. In addition to this, the formula may also contain floating point numbers and parentheses. Mathematical operations have the following order of precedence, listed from lowest to highest. Operators listed on the same line have equal precedence. “+”, “-” “*”, “/”, “%” “^” Unary minus, Unary plus (e.g. -2, meaning 3*-2 is the same as 3*(-2)) Variables, Constants (including numbers) and Functions (as listed previously) Language Description: Digit = ‘0′ | ‘1′ | `2′ | `3′ | `4′ | `5′ | `6′ | `7′ | `8′ | ‘9′ ; number = digit , { digit } ; exponent = [ ‘-’ ] , ( ‘e’ | ‘E’ ) , number ; value = number , [ ‘.’ number ] , [ exponent ] ; variable = ‘$’ | ‘ppt_x’ | ‘ppt_y’ | ‘ppt_w’ | ‘ppt_h’ ; constant = value | ‘pi’ | ‘e’ ; ident = ‘abs’ | `acos’ | `asin’ | `atan’ | `ceil’ | `cos’ | `cosh’ | `deg’ | `exp’ | `floor’ | `ln’ | `max’ | `min’ | `rad’ | `rand’ | `sin’ | `sinh’ | `sqrt’ | `tan’ | ‘tanh’ ; function = ident , ‘(’ , formula [ ‘,’ , formula ] , ‘)’ ; formula = term , { [ ‘+’ | ‘-’ ] , term } ; term = power , { [ ‘*’ | ‘/’ | ‘%’ ] , power } ; power = unary [ ‘^’ , unary ] ; Attributes Description unary = [ ‘+’ | ‘-’ ] , factor ; factor = variable | constant | function | parens ; parens = ‘(’ , formula , ‘)’ ; [Note: Formulas can only support a calcMode (Calculation Mode of linear or discrete. If another calcMode is specified or no calcMode is specified then a calcMode of linear will be assumed. end note] [Note: Any additional characters in the formula string that are not contained within the set described are considered invalid. end note] Variables: Name Description $ Formula input ppt_x Pre-animation x position of the object on the slide ppt_y Pre-animation y position of the object on the slide ppt_w Pre-animation width of the object ppt_h Pre-animation height of the object Constants: Name Description pi Mathematical constant pi e Mathematical constant e Operators: Name Description Usage + Addition “x+y”, adds x to the value y - Subtraction “x-y”, subtracts y from the value x * Multiplication “x*y”, multiplies x by the value y / Division “x/y”, divides x by the value y % Modulus “x%y”, the remainder of x/y ^ Power “x^y”, x raised to the power y Functions: Name Description Usage abs Absolute value “abs(x)”, absolute value of x acos Arc Cosine “acos(x)”, arc cosine of the value x asin Arc Sine “asin(x)”, arc sine of the value x atan Arc Tangent “atan(x)”, arc tangent of the value x Attributes Description ceil Ceil value “ceil(x)”, value of x rounded up cos Cosine “cos(x)”, cosine of the value of x cosh Hyperbolic Cosine “cosh(x)", hyperbolic cosine of the value x deg Radiant to Degree convert “deg(x)”, the degree value of radiant value x exp Exponent “exp(x)”, value of constant e raised to the power of x floor Floor value “floor(x)”, value of x rounded down ln Natural logarithm “ln(x)”, natural logarithm of x max Maximum of two values “max(x,y)”, returns x if (x > y) or returns y if (y > x) min Minimum of two values “min(x,y)", returns x if (x < y) or returns y if (y < x) rad Degree to Radiant convert “rad(x)”, the radiant value of degree value x rand Random value “rand(x)”, returns a random floating point value between 0 and x sin Sine “sin(x)”, sine of the value x sinh Hyperbolic Sine "sinh(x)”, hyperbolic sine of the value x sqrt Square root “sqrt(x)”, square root of the value x tan Tangent “tan(x)”, tangent of the value x tanh Hyperbolic Tangent “tanh(x)", hyperbolic tangent of the value x [Example: Consider the following animation path: <p:animcalcmode="lin" valueType="num"> <p:cBhvr> <p:cTn id="9" dur="664" tmFilter="0.0,0.0; 0.25,0.07; 0.50,0.2; 0.75,0.467; 1.0,1.0"> <p:stCondLst> <p:cond delay="0"/> </p:stCondLst> </p:cTn> <p:tgtEl> <p:spTgtspid="4"/> </p:tgtEl> <p:attrNameLst> <p:attrName>ppt_y</p:attrName> Attributes Description </p:attrNameLst> </p:cBhvr> <p:tavLst> <p:tav tm=”0″ fmla=”#ppt_y-sin(pi*$)/3"> <p:val> <p:fltValval="0.5"/> </p:val> </p:tav> <p:tav tm="100000"> <p:val> <p:fltValval="1"/> </p:val> </p:tav> </p:tavLst> </p:anim> The animation example above modifies the ppt_y variable of the object by subtracting sin(pi*$)/3 from the non-animated value of ppt_y. The start value will be 0.5 and the end value will be 1 specified in each of the val elements. The total time for this animation is specified within the dur attribute and the filtered time graph is specified by the tmFilter attribute. The end result is that the object moves from a point above its non-animated position back to its non-animated position. With the specification of the tmFilter it will have a modified time graph such that it will also appear to accelerate as it reaches its final position. [Note: For this example, the non-animated value of ppt_y will be the value of this variable if the object were to be statically rendered on the slide without animation properties. end note] end example] This attribute allows for a specific formula to be used during the animation. This is specified in a semicolon-separated list of formulas. The value generated by interpolating the values list will be fed into the formula as an input. The resulting value is used to set the property being animated. There should be n-1 number of formulas for n values in the values list. The formula is applied starting at the corresponding time in the keyTimes list and up to the next time in the list. Formulas can only support a calcMode (Calculation Mode) of linear or discrete. If another calcMode is specified or no calcMode is specified then a calcMode of linear will be assumed. Formulas must be written using the elements defined below. When a formula is used in an attribute that takes more than one parameter (such as for animateScale or animateMotion), a space will be taken as a delimiter between parameter values. To work around this, either don’t put spaces in the formula or include parentheses around the formula. Attributes Description Formulas within values, from, to, by attributes can be made up of these: Standard arithmetic operators: `+’, `-`, `*’, `/’, `^’, `%’ (mod) Constants: `pi’ `e’ Conditional operators: `abs’, `min’, `max’, `?’ (if) Comparison operators: ‘==’, ‘>=’, ‘<=’, ‘!=’, ‘!’ Trigonometric operators: `sin()’, `cos()’, `tan()’, `asin()’, `acos()’, `atan()’ Natural logarithm `ln()’ Property references (host supported properties) [Note: The above formula elements are different than those used in javascript expressions. For example "cos()" used in formulas would be "Math.cos()" in javascript. end note] The possible values for this attribute are defined by the XML Schema string datatype.
