/*
 * libvec.h - vector library definitions
 *
 * Version:  2.2 (11/17/87)
 * Author:  Eric Haines
 *
 * Modified: 1 October 1992
 *           Alexander R. Enzmann
 *
 * Modified: 2 August 1993  - More ANSI C compatibility fixes (LIBVEC_H)
 *           Eduard [esp] Schwan
 *
 */
#ifndef LIBVEC_H
#define LIBVEC_H

#include "def.h"

#if __cplusplus
extern "C" {
#endif

#define X_AXIS  0
#define Y_AXIS  1
#define Z_AXIS  2

/* Basic math functions */
void lib_zero_matrix(MATRIX mx);
void lib_create_identity_matrix(MATRIX mx);
void lib_copy_matrix(MATRIX mres, MATRIX mx);
void lib_create_translate_matrix(MATRIX mx, COORD3 vec);
void lib_create_scale_matrix(MATRIX mx, COORD3 vec);
void lib_create_rotate_matrix(MATRIX mx, int axis, double angle);
void lib_create_axis_rotate_matrix(MATRIX mx, COORD3 rvec,
   double angle);
void lib_create_canonical_matrix(MATRIX trans, MATRIX itrans,
   COORD3 origin, COORD3 up);
void lib_create_view_matrix(MATRIX T, COORD3 from, COORD3 at,
   COORD3 up, int xres, int yres,
   double angle, double aspect);
void lib_calc_view_vector(COORD3 from, COORD3 at, COORD3 up, COORD4 axis);
void lib_transform_coord(COORD4 vres, COORD4 vec, MATRIX mx);
void lib_transform_point(COORD3 vres, COORD3 vec, MATRIX mx);
void lib_transform_vector(COORD3 vres, COORD3 vec, MATRIX mx);
void lib_transform_normal(COORD3 vres, COORD3 vec, MATRIX mx);
void lib_transpose_matrix(MATRIX mxres, MATRIX mx);
void lib_matrix_multiply(MATRIX mxres, MATRIX mx1, MATRIX mx2);
double lib_matrix_det4x4(MATRIX);
void lib_invert_matrix(MATRIX, MATRIX);
void lib_rotate_cube_face(COORD3 vec, int major_axis, int mod_face);
int lib_clip_to_box(COORD3 start, COORD3 end,  double bounds[2][3]);
double lib_normalize_vector(COORD3 cvec);
double lib_gauss_rand(long iseed);
void lib_create_orthogonal_vectors(COORD3 axis, COORD3 basis1,
   COORD3 basis2);
void lib_calc_rotation_axis(COORD3 rot_angles, COORD4 axis);

#if __cplusplus
}
#endif

#endif /* LIBVEC_H */
