本文介绍了使用指针或函数声明数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include <iostream>
using namespace std;
int main()
{
    Vectorf point(3);
    point.set(0,0,3.0);
    point.set(1,0,2.0);
    point.set(2,0,1.0);

    double angle = 0.0;
    float sx = 0.5, sy = 0.5;
    float ax = 2.0, ay = 2.0;
    float tx = 0.0, ty = 1.0;
    double const Pi = 4 * atan(1.0);
    angle = Pi / 6 ;
    cout<< "The result of Rotation (angle).Skew(s).Scaling(a).
Translation(t) X M of point is(M'') " << endl <<
        (Rotate_R(Skew_s_X(Skew_s_Y(Scale_a(Translate_t(point,tx,ty),ax,ay),sx),sy),angle));
    cout << endl;
    return 0;
}


我必须将矩阵M={{''3''},{''2''},{''1''}};乘以
(Rotate_R(Skew_s_X(Skew_s_Y(Scale_a(Translate_t(point,tx,ty),ax,ay),sx),sy),angle));
如何声明矩阵并将其乘以上述函数... ???

解决方案


#include <iostream>
using namespace std;
int main()
{
    Vectorf point(3);
    point.set(0,0,3.0);
    point.set(1,0,2.0);
    point.set(2,0,1.0);

    double angle = 0.0;
    float sx = 0.5, sy = 0.5;
    float ax = 2.0, ay = 2.0;
    float tx = 0.0, ty = 1.0;
    double const Pi = 4 * atan(1.0);
    angle = Pi / 6 ;
    cout<< "The result of Rotation (angle).Skew(s).Scaling(a).
Translation(t) X M of point is(M'') " << endl <<
        (Rotate_R(Skew_s_X(Skew_s_Y(Scale_a(Translate_t(point,tx,ty),ax,ay),sx),sy),angle));
    cout << endl;
    return 0;
}


i have to multiply a matrix M={{''3''},{''2''},{''1''}}; to
(Rotate_R(Skew_s_X(Skew_s_Y(Scale_a(Translate_t(point,tx,ty),ax,ay),sx),sy),angle));
how to declare a matrix and multiply it to the above thing...???

解决方案



这篇关于使用指针或函数声明数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 01:42
查看更多