【NX二次开发】单位化向量

单位化向量

#include "me.hpp"

extern DllExport void ufusr(char *param, int *returnCode, int rlen)
{
    UF_initialize();

    double douV[3] = { 0,2,2 };
    double douUnitizeV[3] = { 0,0,0 };
    double tolerance = 0.001;
    double    magnitude = 0;
    UF_VEC3_unitize(douV, tolerance, &magnitude, douUnitizeV);
    print("%f\n", magnitude);
    print("%f,%f,%f\n", douUnitizeV[0], douUnitizeV[1], douUnitizeV[2]);

    UF_terminate();
}

extern int ufusr_ask_unload(void)
{
    return (UF_UNLOAD_IMMEDIATELY);
}

 效果:

 

posted @ 2022-06-18 16:03  王牌飞行员_里海  阅读(63)  评论(0编辑  收藏  举报