EasyManua.ls Logo

Adobe AFTER EFFECTS 7.0 - Layer General attributes and methods; Layer Properties attributes and methods

Adobe AFTER EFFECTS 7.0
684 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ADOBE AFTER EFFECTS 7.0
User Guide
573
Vector Math methods
VectorMathfunctionsareglobalmethodsthatperformoperationsonarrays,treatingthemasmathematicalvectors.
Unlike built-in JavaScript methods, such as
Math.sin,thesemethodsarenotusedtheMath prefix . Unless otherwise
specified, Vector Math methods are lenient about dimensions and return a value that is the dimension of the largest
Array, filling in missing elements with zeros. For example, the expression
[10, 20]+[1, 2, 3] returns [11, 22, 3].
add(vec1, vec2) Return type: Array. Adds two vectors.
Argument type: vec1 and vec2 are Arrays.
sub(vec1, vec2) Return type: Array.
Argument type: vec1 and vec2 are Arrays.
Subtracts two vectors.
mul(vec, amount) Return type: Array.
Argument type: vec is an Array, amount is a Number.
Multiplies every element of the vector by the amount.
div(vec, amount) Return type: Array.
Argument type: vec is an Array, amount is a Number.
Divides every element of the vector by the amount.
clamp(value, limit1, limit2) Return type: Number or Array.
Argument type: value, limit1, and limit2 are Numbers or Arrays.
The value of each component of value is constrained to fall between the values of the corresponding values of limit1
and limit2.
dot(vec1, vec2) Return type: Number.
Argument type: vec1 and vec2 are Arrays.
Returns the dot (inner) product of the vector arguments.
cross(vec1, vec2) Return type: Array [2 or 3].
Argument type: vec1 and vec2 are Arrays [2 or 3].
Returns the vector cross product of vec1 and vec2. Refer to a math reference or JavaScript guide for more infor-
mation.
normalize(vec) Return type: Array.
Argument type: vec is an Array.
Normalizes the vector so that its length is 1.0. This is a short way of writing
div(vec, length(vec)).
length(vec) Return type: Number.
Argument type: vec is an Array.
Returns the length of vector vec.
length(point1, point2) Return type: Number.
Argument type: point1 and point2 are Arrays.

Table of Contents

Related product manuals