Chief Ray Photogrammetric and Mapping Software
|
Input arrays The functions in RayTools for Excel accept two different types of array arguments as inputs: rectangular Excel ranges, and array constants. Rectangular Excel ranges can either be 2-dimensional or 1-dimensional. A 2-dimensional range such as A1:C3 holds a matrix, and a 1-dimensional range such as A1:A5 holds a vector. RayTools makes no distinction between column vectors and row vectors—the values in the range are just assigned to the vector elements in left-to-right or top-to-bottom order, as appropriate. Array constants are lists of numbers, separated by commas, that are entered in the formula bar. Lists begin with { and end with }. If the array is 2-dimensional, the numbers are assigned row-wise to array elements with semicolons separating the rows. For example, a formula that computes the norm of a specific 4x4 matrix might be entered in the formula bar as =matnorm({1,9,8,3;2,3,6,1;5,4,3,7;4,1,2,3}) . The corresponding formula to compute the norm of the 4-vector in the the first column of the same matrix might be entered as =vnorm(1,2,5,4) . Output array RayTools uses array formulas to compute an output array and load it into a rectangular range. To enter an array formula, an output range must first be selected. Then the formula is entered into the formula bar followed by Ctrl-Shift-Enter. Of course, an array constants cannot be used to hold the output of an array formula. Similar to an input range, the output range may be 2-dimensional for a matrix, or 1-dimensional for a vector. An output vector range may either be a horizontal column range or a vertical row range, depending on the shape of the range selected by the user. Example RayTools for Excel allows a vector of any length, including a 3-vector, quaternion, or general n-vector, to be expressed either as a vertical or a horizontal range. (A quaternion is expressed as a vector of length 4, with the first element holding the scalar portion.) For example, the sheet below has quaternions in the column range B1:B4 and row range D2:G2.
The quaternion in B1:B4 has a 3 as its scalar portion, and (2, 2.5, 5.72) as its vector portion. Now, say that we want to multiply these two quaternions together and place the result in the row range C6:F6. To multiply quaternions, we use the RayTools function QMULT as follows:
Excel multiplies the quaternions and places the product in the highlighted destination range.
The same result could have been placed into a vertical column range by selecting a vertical destination range in step 1. Tips
|
For more information, contact Chief Ray .
|