|
|
#pragma once
|
|
|
#include "dllExport.h"
|
|
|
#include <math.h>
|
|
|
#include "XJPoint3D.h"
|
|
|
|
|
|
/*************************************************************************
|
|
|
*函数名称: VectorDot
|
|
|
*函数功能: 矩阵点乘
|
|
|
*输入参数: a--------------------第一个矢量
|
|
|
b--------------------第二个矢量
|
|
|
*返回值: 返回模
|
|
|
*************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT double VectorDot(const Point3D &a, const Point3D &b);
|
|
|
|
|
|
/*************************************************************************
|
|
|
*函数名称: VectorCross
|
|
|
*函数功能: 矢量叉乘
|
|
|
*输入参数: a--------------------第一个矢量
|
|
|
b--------------------第二个矢量
|
|
|
res------------------返回结果矢量
|
|
|
*************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT void VectorCross(const Point3D &a, const Point3D &b, Point3D &res);
|
|
|
|
|
|
/*************************************************************************
|
|
|
*函数名称: Normalized
|
|
|
*函数功能: 矢量单位化
|
|
|
*输入参数: a--------------------输入参数
|
|
|
*输出参数: a--------------------输出参数
|
|
|
*返回值 : bool-----------------表示单位化是否成功
|
|
|
*************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT bool Normalized(Point3D &a);
|
|
|
|
|
|
/***************************************************************************
|
|
|
*函数名称: GetAngle
|
|
|
*函数功能: 获取两个矢量之间的角度
|
|
|
*输入参数: V1-------------------第一个矢量
|
|
|
*输入参数: V2-------------------第二个矢量
|
|
|
*返回值 : double---------------两矢量之间的弧度值
|
|
|
****************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT double GetAngle(const Point3D V1,const Point3D V2);
|
|
|
|
|
|
/***************************************************************************
|
|
|
*函数名称: GetAngleLineWithPlane
|
|
|
*函数功能: 计算直线与平面的角度
|
|
|
*输入参数: lineDir-------------------直线方向
|
|
|
linrBace------------------直线基点
|
|
|
planeDir------------------平面方向
|
|
|
planeBace-----------------平面基点
|
|
|
*输入参数: resultAngle----------------夹角,单位度数(。)
|
|
|
*返回值 : int------------------------返回0表示成功
|
|
|
****************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT int GetAngleLineWithPlane(Point3D lineDir,Point3D linrBace,Point3D planeDir, Point3D planeBace, double& resultAngle);
|
|
|
|
|
|
/***************************************************************************
|
|
|
*函数名称: GetAnglePlaneWithPlane
|
|
|
*函数功能: 计算平面与平面的角度
|
|
|
*输入参数: planeDir1-------------------直线方向
|
|
|
planeBace1------------------直线基点
|
|
|
planeDir2------------------平面方向
|
|
|
planeBace2-----------------平面基点
|
|
|
*输入参数: resultAngle----------------夹角,单位度数(。)
|
|
|
*返回值 : int------------------------返回0表示成功
|
|
|
****************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT int GetAnglePlaneWithPlane(Point3D planeDir1,Point3D planeBace1,Point3D planeDir2, Point3D planeBace2, double& resultAngle);
|
|
|
|
|
|
/***************************************************************************
|
|
|
*函数名称: TranslatePtByDir
|
|
|
*函数功能: 点沿方向移动一定距离
|
|
|
*point----------------点 I/O
|
|
|
*dir------------------方向 I
|
|
|
*distance-------------距离 I
|
|
|
****************************************************************************/
|
|
|
extern "C" XJ_ALGO_EXPORT void TranslatePtByDir(Point3D& point, Point3D& dir, float distance);
|
|
|
|
|
|
extern "C" XJ_ALGO_EXPORT int CalcTriNormal( Point3D& p0, Point3D& p1, Point3D& p2, Point3D &po);
|