00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MATRIX_H_INCLUDED
00025 #define MATRIX_H_INCLUDED 1
00026
00027 #include "utilities.h"
00028
00029
00030
00031
00032
00033 typedef double Vector3x1[3][1];
00034
00035 void make_vec(Vector3x1 vec, double x, double y);
00036 CheapPointType vec_to_point(Vector3x1 vec);
00037 void point_to_vec(CheapPointType pt, Vector3x1 vec);
00038
00039
00040
00041
00042
00043 typedef double Matrix3x3[3][3];
00044
00045 void make_identity_matrix(Matrix3x3 mat);
00046 void make_translation_matrix(Matrix3x3 mat, double dx, double dy);
00047 void make_rotation_matrix(Matrix3x3 mat, double theta);
00048 void make_reflection_matrix_x_axis(Matrix3x3 mat);
00049 void make_reflection_matrix_y_axis(Matrix3x3 mat);
00050 void copy_matrix(Matrix3x3 src, Matrix3x3 dst);
00051
00052 void multiply_matrix_vector(Matrix3x3 mat, Vector3x1 vec,
00053 Vector3x1 result);
00054 void multiply_matrix_matrix(Matrix3x3 mat1, Matrix3x3 mat2,
00055 Matrix3x3 result);
00056 void multiply_matrix_matrix_inplace(Matrix3x3 mat1, Matrix3x3 mat2);
00057 CheapPointType transform_point(Matrix3x3 mat, CheapPointType pt);
00058
00059
00060
00061
00062
00063 void log_vector(Vector3x1 vec);
00064 void debug_log_vector(Vector3x1 vec);
00065 void log_matrix(Matrix3x3 mat);
00066 void debug_log_matrix(Matrix3x3 mat);
00067
00068 #endif