MatrixSine.cpp
Go to the documentation of this file.
00001 #include <unsupported/Eigen/MatrixFunctions>
00002 #include <iostream>
00003 
00004 using namespace Eigen;
00005 
00006 int main()
00007 {
00008   MatrixXd A = MatrixXd::Random(3,3);
00009   std::cout << "A = \n" << A << "\n\n";
00010 
00011   MatrixXd sinA = A.sin();
00012   std::cout << "sin(A) = \n" << sinA << "\n\n";
00013 
00014   MatrixXd cosA = A.cos();
00015   std::cout << "cos(A) = \n" << cosA << "\n\n";
00016   
00017   // The matrix functions satisfy sin^2(A) + cos^2(A) = I, 
00018   // like the scalar functions.
00019   std::cout << "sin^2(A) + cos^2(A) = \n" << sinA*sinA + cosA*cosA << "\n\n";
00020 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:31:59