{"id":51,"date":"2013-11-08T15:46:23","date_gmt":"2013-11-08T15:46:23","guid":{"rendered":"\/\/3dbym.ru\/2013\/11\/the-cd-s-code\/"},"modified":"2013-11-08T15:46:23","modified_gmt":"2013-11-08T15:46:23","slug":"the-cd-s-code","status":"publish","type":"post","link":"https:\/\/3dbym.ru\/2013\/11\/the-cd-s-code\/","title":{"rendered":"The CD\u2019s Code"},"content":{"rendered":"
Take a look at the following directory on the CD: \/Code\/Chapterl\/ or \/Code\/Math. Here, you will find C++ classes to store and manipulate matrices and vectors. There are separate classes for 3×3 and 4×4 matrices, both defined and implemented in the files matrix. cpp and matrix. inl. The same goes for vectors. There are classes for both 2D and 3D vectors, defined and implemented in vector. h and vector. inl. All of the classes contain a variety of functions to perform the opera\u00adtions covered here, as well as overloaded operators that can be used to do the basic mathematical operations such as addition and subtrac\u00adtion. There are even operators to compare two matrices or vectors and tell you if they are equal. All these operators allow you to use matrices and vectors as if you were just using real numbers. Syntax such as vectorl = vector2 + vector3 and if(matrix1 == matrix2) are both valid thanks to the wonderful features of C++ that allow programmers to override the default definition of the mathematical operators.<\/p>\n
In both directories you will notice a few extra files, as follows:<\/p>\n
■ math. h is the main header file that basically includes all of the other files, ensuring that you get all of the functionality avail\u00adable, without needing to remember to include a bunch of files.<\/p>\n
<\/p>\n