Performing vector operations (PB only)Motion Math includes three functions that are special to vectors: dot product, cross product, and distance. The dot product of two vectors produces a single value. It multiplies the same indexed values together and adds the products, as shown below: V = {x, y} W = {a, b} V · W = x*a + y*b The Motion Math dot-product function uses the following format, in which a and b are vectors: dot (a, b) The cross product of two vectors produces a third vector, which is perpendicular to the plane formed by the other two and points in the direction indicated by the coordinate system. The cross product of two vectors produces a vector with the same number of dimensions. The Motion Math cross-product function uses the following format, in which a and b are vectors: cross (a, b) The distance between two vectors can be determined if each vector is plotted as a point in a coordinate system. The Motion Math distance function uses the following format, in which a and b are vectors: dist (a, b) The resulting value is in pixels. You can use the Motion Math distance function to calculate the distance between two layers, using vectors for the Position property. |