@@ -72,11 +72,14 @@ public class Matrix implements Serializable {
72
72
public static final int I33 = 8 ;
73
73
private static final long serialVersionUID = 7434885566068528477L ;
74
74
75
- /** the values inside the matrix (the identity matrix by default).
76
- * <p>For reference, the indeces are as follows:<p>
77
- * I11 I12 I13<p>
78
- * I21 I22 I23<p>
79
- * I31 I32 I33<p>
75
+ /**
76
+ * The values inside the matrix (the identity matrix by default).
77
+ *
78
+ * <p>
79
+ * For reference, the indeces are as follows:
80
+ * <br>I11 I12 I13
81
+ * <br>I21 I22 I23
82
+ * <br>I31 I32 I33
80
83
*/
81
84
private final float [] vals = new float []{
82
85
1 ,0 ,0 ,
@@ -91,7 +94,8 @@ public Matrix() {
91
94
}
92
95
93
96
/**
94
- * Constructs a matrix that represents translation
97
+ * Constructs a matrix that represents translation.
98
+ *
95
99
* @param tx x-axis translation
96
100
* @param ty y-axis translation
97
101
*/
@@ -101,7 +105,8 @@ public Matrix(float tx, float ty) {
101
105
}
102
106
103
107
/**
104
- * Creates a Matrix with 9 specified entries
108
+ * Creates a Matrix with 9 specified entries.
109
+ *
105
110
* @param e11 element at position (1,1)
106
111
* @param e12 element at position (1,2)
107
112
* @param e13 element at position (1,3)
@@ -125,9 +130,10 @@ public Matrix(float e11, float e12, float e13, float e21, float e22, float e23,
125
130
}
126
131
127
132
/**
128
- * Creates a Matrix with 6 specified entries
133
+ * Creates a Matrix with 6 specified entries.
129
134
* The third column will always be [0 0 1]
130
135
* (row, column)
136
+ *
131
137
* @param a element at (1,1)
132
138
* @param b element at (1,2)
133
139
* @param c element at (2,1)
@@ -150,23 +156,25 @@ public Matrix(float a, float b, float c, float d, float e, float f){
150
156
/**
151
157
* Gets a specific value inside the matrix.
152
158
*
153
- * <p>For reference, the indeces are as follows:<p>
154
- * I11 I12 I13<p>
155
- * I21 I22 I23<p>
156
- * I31 I32 I33<p>
159
+ * <p>
160
+ * For reference, the indeces are as follows:
161
+ * <br>I11 I12 I13
162
+ * <br>I21 I22 I23
163
+ * <br>I31 I32 I33
157
164
*
158
- * @param index an array index corresponding with a value inside the matrix
159
- * @return the value at that specific position.
165
+ * @param index an array index corresponding with a value inside the matrix
166
+ * @return the value at that specific position.
160
167
*/
161
168
public float get (int index ){
162
169
return vals [index ];
163
170
}
164
171
165
172
/**
166
- * multiplies this matrix by 'b' and returns the result
173
+ * multiplies this matrix by 'b' and returns the result.
167
174
* See http://en.wikipedia.org/wiki/Matrix_multiplication
175
+ *
168
176
* @param by The matrix to multiply by
169
- * @return the resulting matrix
177
+ * @return the resulting matrix
170
178
*/
171
179
public Matrix multiply (Matrix by ){
172
180
Matrix rslt = new Matrix ();
@@ -189,7 +197,8 @@ public Matrix multiply(Matrix by){
189
197
}
190
198
191
199
/**
192
- * adds a matrix from this matrix and returns the results
200
+ * Adds a matrix from this matrix and returns the results.
201
+ *
193
202
* @param arg the matrix to subtract from this matrix
194
203
* @return a Matrix object
195
204
*/
@@ -215,7 +224,8 @@ public Matrix add(Matrix arg){
215
224
}
216
225
217
226
/**
218
- * Subtracts a matrix from this matrix and returns the results
227
+ * Subtracts a matrix from this matrix and returns the results.
228
+ *
219
229
* @param arg the matrix to subtract from this matrix
220
230
* @return a Matrix object
221
231
*/
@@ -241,6 +251,7 @@ public Matrix subtract(Matrix arg){
241
251
242
252
/**
243
253
* Computes the determinant of the matrix.
254
+ *
244
255
* @return the determinant of the matrix
245
256
*/
246
257
public float getDeterminant (){
@@ -257,8 +268,9 @@ public float getDeterminant(){
257
268
258
269
/**
259
270
* Checks equality of matrices.
260
- * @param obj the other Matrix that needs to be compared with this matrix.
261
- * @return true if both matrices are equal
271
+ *
272
+ * @param obj the other Matrix that needs to be compared with this matrix.
273
+ * @return true if both matrices are equal
262
274
* @see java.lang.Object#equals(java.lang.Object)
263
275
*/
264
276
@ Override
@@ -271,6 +283,7 @@ public boolean equals(Object obj) {
271
283
272
284
/**
273
285
* Generates a hash code for this object.
286
+ *
274
287
* @return the hash code of this object
275
288
* @see java.lang.Object#hashCode()
276
289
*/
@@ -281,6 +294,7 @@ public int hashCode() {
281
294
282
295
/**
283
296
* Generates a String representation of the matrix.
297
+ *
284
298
* @return the values, delimited with tabs and newlines.
285
299
* @see java.lang.Object#toString()
286
300
*/
0 commit comments