sihart25 / mathematicslibrary Goto Github PK
View Code? Open in Web Editor NEWThe aim of this assessment was to create a set of classes that would form the basis of a mathematics library to be used in the ray caster and ray tracer assessments. The design was to be object-oriented and the program was to be written in C++. The code was to be efficient, well structured, commented and maintainable. The design was to include a Vector class to encapsulate the behaviour of a three-dimensional point or vector, and a Ray class to encapsulate the behaviour of an infinite three-dimensional line or ray. Both classes were to provide constructors, selectors, input and output streaming, and various mathematical operators and functions. The Vector class was to include mathematical operators and functions for addition, subtraction, scalar multiplication, negation, cross product, dot product, magnitude, normalise, and the distance between two points. The Ray class was to include the mathematical operators and functions for negation, the distance between a point and a line, the distance between two lines, and the intersection between two rays. This intersection could also be used to construct a Vector object. If possible, the design was to include a Matrix class to encapsulate the behaviour of a three-dimensional transformation, which could be applied to either a Vector or Ray object.
License: GNU General Public License v3.0