当前位置:   article > 正文

vector 2维向量_vector2 的法线

vector2 的法线

#include<iostream>

#include<vector>

#include<algorithm>

 

using namespace std;

 

vector<vector<double>> test()

{

    vector<vector<double> > array2D(5, vector<double>(3));

    array2D[2][2] = 10.0;

    cout << "array2D[2][2]:" << array2D[2][2] << endl;

    return array2D;

 

}

 

int main()

{

    cout << "********************二维向量*************************" << endl;

 

    vector<vector<int>> aa;

 

    vector<vector<double>> array2D(5, vector<double>(3));

    array2D[1][2] = 6.0;

    cout << "array2D[1][2]:" << array2D[1][2] << endl;

    //array2D[1][3] = 7.0;

 

    // 设置容器大小(HEIGHT x WIDTH)

    array2D.resize(5);

    for (int i = 0; i < 3; ++i)

        array2D[i].resize(3);

 

    //放入一些数据

    array2D[1][2] = 6.0;

    array2D[1][1] = 5.5;

    cout << "array2D的行数:" << array2D.size() << endl;

    cout << "array2D的列数:" << array2D[0].size() << endl;

 

 

    vector<vector<double>> test2;

    test2 = test();

    cout << "test2[2][2]:" << test2[2][2] << endl;

    cout << "test2的行数:" << test2.size() << endl;

    cout << "test2的列数:" << test2[2].size() << endl;

   

 

    system("pause");

    return 0;

}

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/108462
推荐阅读
相关标签
  

闽ICP备14008679号