📄 pf_vector.h
字号:
/************************************************************************** * Desc: Vector functions * Author: Andrew Howard * Date: 10 Dec 2002 * CVS: $Id: pf_vector.h,v 1.3 2003/02/10 01:37:19 inspectorg Exp $ *************************************************************************/#ifndef PF_VECTOR_H#define PF_VECTOR_H#ifdef __cplusplusextern "C" {#endif#include <stdio.h> // The basic vectortypedef struct{ double v[3];} pf_vector_t;// The basic matrixtypedef struct{ double m[3][3];} pf_matrix_t;// Return a zero vectorpf_vector_t pf_vector_zero();// Check for NAN or INF in any componentint pf_vector_finite(pf_vector_t a);// Print a vectorvoid pf_vector_fprintf(pf_vector_t s, FILE *file, const char *fmt);// Simple vector additionpf_vector_t pf_vector_add(pf_vector_t a, pf_vector_t b);// Simple vector subtractionpf_vector_t pf_vector_sub(pf_vector_t a, pf_vector_t b);// Transform from local to global coords (a + b)pf_vector_t pf_vector_coord_add(pf_vector_t a, pf_vector_t b);// Transform from global to local coords (a - b)pf_vector_t pf_vector_coord_sub(pf_vector_t a, pf_vector_t b);// Return a zero matrixpf_matrix_t pf_matrix_zero();// Check for NAN or INF in any componentint pf_matrix_finite(pf_matrix_t a);// Print a matrixvoid pf_matrix_fprintf(pf_matrix_t s, FILE *file, const char *fmt);// Compute the matrix inverse. Will also return the determinant,// which should be checked for underflow (indicated singular matrix).pf_matrix_t pf_matrix_inverse(pf_matrix_t a, double *det);// Decompose a covariance matrix [a] into a rotation matrix [r] and a// diagonal matrix [d] such that a = r * d * r^T.void pf_matrix_unitary(pf_matrix_t *r, pf_matrix_t *d, pf_matrix_t a);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -