#ifndef ARITH_UTILS_H
#define ARITH_UTILS_H

#pragma once
#include "Arith_SysStruct.h"
#include "opencv2/opencv.hpp"

using cv::Point2d;
using cv::Point2f;




unsigned char FourPointInterpolation(unsigned char* pSrcImage, int iWidth, int iHeight, float x, float y);

// 矩阵加法
void AddMat(double* A, double* B, int mn, double* AaddB);

// 矩阵乘法
void  MultiMat(double* A, double* B, double* AB, int m, int n, int p);

// M1(3*3) * M2(3*3)
void  MultiMat33(double* A, double* B, double* AB);

// M1(3*3) * M2(3*3) * M3(3*3)
void  MultiMat333(double* A, double* B, double* C, double* ABC);


// 标量乘以矩阵
void MultiMatScalar(double scalar, double* A, double* sA, int mn);

// 矩阵转置
void TransposeMat(double* A, int m, int n, double* AT);

// 3阶矩阵逆，不判断逆是否存在
void invMat3(double* A, double* invA);


// 获得三阶单位阵
void eye3(double* M);

// 绕X轴旋转矩阵
void Rx(double omega, double* Opp);

// 绕Y轴旋转矩阵
void Ry(double omega, double* Opp);

// 绕Z轴旋转矩阵
void Rz(double omega, double* Opp);

// 镜面反射矩阵
void RMirror(PointXYZ normalVec, double* Opp);

// 坐标(矢量)旋转: M1(3*3) * M2(3,1)
PointXYZ  RtPoint(double* M, PointXYZ Point);

// 坐标(矢量)归一化
PointXYZ NormPoint(PointXYZ Point);

// 罗得里格公式
void rotationVectorToMatrix(PointXYZ rotaVec_One, float rotaAgl, double* Mat);

// 获取动态库所在路径
std::string GetDynamicLibraryPath();
#endif