UG\NX secondary development of affine transformation (addition of unscaled vector and scaled vector) UF_VEC2_affine_comb

Author of the article: Caspian
Source website: Ace Pilot_Caspian_Caspian NX secondary development 3000 examples, Caspian BlockUI column, C\C++-CSDN blog


Introduction:

    Performs an affine combination of vectors, which consists of adding an unscaled vector to a scaled vector. The first vector of input is vec[2], which is unscaled. The second vector of input is vec_to_scale[2], which is scaled by the input parameter scale. The resulting vector is output to vec_comb[2] = vec + (scale * vec_to_scale).

Effect:

      

Code:

#include "me.hpp"

void doIt()
{
    const double vec1[2] = { 1.0,2.0 };
    const double vec2[2] = { 2.0,2.0 };
    double scale =2.0;
    double vecComb[2];
    UF_VEC2_affine_comb(vec1, scale, vec2, vecComb);
    print("vec1{%f,%f}+%f * vec2{%f,%f}={%f,%f}", vec1[0], vec1[1], scale, vec2[0], vec2[1], ve

Guess you like

Origin blog.csdn.net/WangPaiFeiXingYuan/article/details/132906518