If you are going to make a library to support linear transformations of points in 3D, then you should implement a support class Matrix that has the following methods:
Signature of Method | Purpose of Method | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
void identity() | set to the identity
void set(int i, int j, double value)
| set a value
| double get(int i, int j)
| get a value
| void translate(double a, double b, double c)
| translate by (a,b,c)
| void rotateX(double theta)
| rotate about X axis by θ radians
| void rotateY(double theta)
| rotate about Y axis by θ radians
| void rotateZ(double theta)
| rotate about Z axis by θ radians
| void scale(double a, double b, double c)
| scale by (a,b,c) about the origin
| void transform(double src[], double dst[])
| transform point src[], put the result into dst[]
| |