Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ intconcat_m(3G) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

concat_transformation(3G)

flush_matrices(3G)

pop_matrix(3G)

push_matrix(3G)

replace_matrix(3G)

concat_matrix(3G)

NAME

concat_matrix, intconcat_matrix2d − multiply two matrices and return the resulting matrix

SYNOPSIS

C Syntax:

void concat_matrix(matrix1,matrix2,result);
float matrix1[4][4],matrix2[4][4],result[4][4];

void intconcat_matrix2d(matrix1,matrix2,result,radix1,radix2,radix,raw);
int matrix1[3][2],matrix2[3][2],result[3][2],radix1,radix2,*radix,raw;

FORTRAN77 Syntax:

(See Language Dependencies Below)

subroutine concat_matrix(matrix1,matrix2,result)
real matrix1(4,4),matrix2(4,4),result(4,4)

subroutine intconcat_matrix2d(matrix1,matrix2,result,
radix1,radix2,radix,raw)
integer*4 matrix1(2,3),matrix2(2,3),result(2,3),radix1,radix2,radix,raw

Pascal Syntax:

type

three_d_xform = array[1..4][1..4] of real;
int2d_xform = array[1..3][1..2] of integer;

procedure concat_matrix(var matrix1,matrix2,result:three_d_xform);

procedure intconcat_matrix2d(var matrix1,matrix2,result:int2d_xform;
radix1,radix2:integer;var radix:integer; raw:integer);

DESCRIPTION

Input Parameters

matrix1,matrix2
Two user-supplied 4x4 real matrices presented in row major form, or two user-supplied 3x2 integer matrices presented in row major form.

radix1,radix2 The radix factors for the 3x2 integer matrices. 

raw If set to  TRUE(1) all integer matrices will be in internal (raw) format (i.e. translation values are not scaled). 
If set to FALSE(0), all integer matrix values are scaled.

Output Parameters

result Resulting 4x4 real matrix obtained by multiplying matrix1 and matrix2 . 
Resulting 3x2 integer matrix obtained by multiplying matrix1 and matrix2. 

radix is the resulting radix factor for a 3x2 integer matrix. 

Discussion

Concatenation (or matrix multiplication) multiplies matrix1 and matrix2 and the resulting matrix is placed in result:

matrix1 * matrix2 → result

The three matrices need not be unique.  For instance, concat_matrix or intconcat_matrix2d (A,A,A) is valid. 

When multiplying integer matrices they are given an implied third column that is 0,0,1. This allows a full 3x3 matrix multiply, and does not distort the resulting picture. The third column is removed from the result matrix. 

Integer transformation matrices are scaled to allow a fractional portion for rotating objects.  The radix factor indicates the number of bits to the right of the decimal point. Legal limits are 0 to 30. Once a coordinate has been transformed, it is divided by 2**radix to return to an integer value. 

When using raw mode with an integer matrix positions (2,0) and (2,1) have an implied radix factor of 0(no scaling). This allows large translation ranges along with accurate rotations. 

Integer operations are only available when using the INT_XFORM gopen mode. When in INT_XFORM mode, floating point operations are not available for that fildes. Floating point operations are the default, or can be specified with FLOAT_XFORM mode. For a list of integer operations, floating point operations and common operations see the starbase.3g manual page. 

LANGUAGE DEPENDENCIES

FORTRAN77:
A transposition of array rows and columns is required due to the manner in which FORTRAN77 stores arrays. 

SEE ALSO

concat_transformation(3G), flush_matrices(3G), pop_matrix(3G), push_matrix(3G), replace_matrix(3G). 

Hewlett-Packard Company  —  HP-UX Release 9.10: April 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026