?? affine2d.cc
字號:
const char *help = "\progname: affine2D.cc\n\code2html: This program tests Affine2D class methods.\n\version: Torch3 vision2.0, 2003-2005\n\(c) Sebastien Marcel (marcel@idiap.ch)\n";#include "general.h"#include "RotationMatrix2D.h"#include "Affine2D.h"#include "CmdLine.h"using namespace Torch;int main(int argc, char **argv){ real x, y; real xc, yc; real angle; bool verbose; // Construct the command line CmdLine cmd; cmd.setBOption("write log", false); // Put the help line at the beginning cmd.info(help); cmd.addText("\nArguments:"); cmd.addRCmdArg("x", &x, "x"); cmd.addRCmdArg("y", &y, "y"); cmd.addRCmdArg("xc", &xc, "xc"); cmd.addRCmdArg("yc", &yc, "yc"); cmd.addRCmdArg("angle", &angle, "ccw angle in degree"); cmd.addText("\nOptions:"); cmd.addBCmdOption("-verbose", &verbose, false, "verbose"); cmd.read(argc, argv); // RotationMatrix2D r(angle); print("rotation matrix = %s\n", r.sprint()); // Vector2D v(xc, yc); print("translation vector = %s\n", v.sprint()); // Affine2D affine(r, v); // Vector2D X(x, y); print("X = %s\n", X.sprint()); Vector2D X_(0, 0); // X_ = affine * X; print("X' = %s\n", X_.sprint()); // Vector2D w(xc, xc); print("translation vector = %s\n", w.sprint()); // X_ = X_ + w; print("X' + w = %s\n", X_.sprint()); // RotationMatrix2D r_1(-angle); print("rotation matrix inverse = %s\n", r_1.sprint()); // Affine2D affine_1(r_1, w); print("X' + w = %s\n", X_.sprint()); Vector2D X_1(0, 0); X_1 = affine_1 * X_; print("X_1 = %s\n", X_1.sprint()); X_1 += v; print("X-1 + v = %s == %s\n", X_1.sprint(), X.sprint());}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -