Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$POSTMULT                     Domain/OS                      VEC_$POSTMULT


NAME
     vec_$postmult - multiply a single-precision vector by a 4x4 matrix

SYNOPSIS (C)
     #include <apollo/base.h>
     #include <apollo/vec.h>

     void vec_$postmult(
          float *matrix,
          float *start_vec,
          float *result_vec)

SYNOPSIS (Pascal)
     %include '/sys/ins/base.ins.pas';
     %include '/sys/ins/vec.ins.pas';

     procedure vec_$postmult(
          in matrix: univ vec_$real_matrix;
          in start_vec: univ vec_$real_vector;
          out result_vec: univ vec_$real_vector);

SYNOPSIS (FORTRAN)
     %include '/sys/ins/base.ins.ftn'
     %include '/sys/ins/vec.ins.ftn'

           real matrix(4, 4), start_vec(4), result_vec(4)

           call vec_$postmult(matrix, start_vec, result_vec)

DESCRIPTION
     Vec_$postmult multiplies the 4-element vector start_vec by the 4x4 matrix
     matrix.

     In C, vec_$postmult applies matrix as a right transform to a row vector
     start_vec, and the resulting operation is

          for (j = 0; j < 4; ++j) {
               result_vec[j] = 0.0;
               for (i = 0; i < 4; ++i)
                    result_vec[j] += start_vec[i]
                                  * matrix[i][j];
          }

     In Pascal, vec_$postmult applies matrix as a right transform to a row
     vector start_vec, and the resulting operation is

          for j := 1 to 4 do
               begin
               result_vec[j] := 0.0;
               for i := 1 to 4 do
                    result_vec[j] := result_vec[j]
                                  + start_vec[i]
                                  * matrix[i,j];
               end

     In FORTRAN, vec_$postmult applies matrix as a left transform to a column
     vector start_vec, and the resulting operation is

           do 10 j = 1, 4
               result_vec(j) = 0.0
               do 10 i = 1, 4
                    result_vec(j) = result_vec(j)
          &                       + start_vec(i)
          &                       * matrix(j,i)
       10  continue

     matrix
          The matrix to multiply by start_vec.

     start_vec
          The vector to multiply by matrix.

     result_vec
          The product of start_vec and matrix.

NOTES
     Vec_$premult transforms single-precision vectors from the other side.

SEE ALSO
     vec_$dpostmult, vec_$ipostmult, vec_$ipostmult16.

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