文章作者:里海
来源网站:王牌飞行员_里海_里海NX二次开发3000例,里海BlockUI专栏,C\C++-CSDN博客
简介:
UG二次开发 向量叉乘 UF_VEC3_cross,xyz三个向量已知2个求另外1个。
效果:
代码:
#include "me.hpp"
void ufusr(char* param, int* retcode, int paramLen)
{
UF_initialize();
//已知xy求z
double x1[3] = { 1.0,0.0,0.0 };
double y1[3] = { 0.0,1.0,0.0 };
double z1[3] = { 0 };
UF_VEC3_cross(x1, y1, z1);
print("z1 %f,%f,%f\n", z1[0], z1[1], z1[2]);
//已知yz求x
double y2[3] = { 0.0,1.0,0.0 };
double z2[3] = { 0.0,0.0,1.0 };
double x2[3] = { 0 };
UF_VEC3_cross(y2, z2, x2);
print("x2 %f,%f,%f\n", x2