@@ -24,50 +24,109 @@ You should have received a copy of the GNU Affero General Public License
2424using iText . Commons . Utils ;
2525
2626namespace iText . Kernel . Geom {
27- /// <summary>
28- /// Keeps all the values of a 3 by 3 matrix and allows you to
29- /// do some math with matrices.
30- /// </summary>
27+ /// <summary>Keeps all the values of a 3 by 3 matrix and allows you to do some math with matrices.</summary>
28+ /// <remarks>
29+ /// Keeps all the values of a 3 by 3 matrix and allows you to do some math with matrices.
30+ /// <para />
31+ /// Transformation matrix in PDF is a special case of a 3 by 3 matrix
32+ /// <br />
33+ /// <c>[a b 0]</c>
34+ /// <br />
35+ /// <c>[c d 0]</c>
36+ /// <br />
37+ /// <c>[e f 1]</c>
38+ /// <para />
39+ /// In its most general form, this matrix is specified by six numbers, usually in the form of an array containing six
40+ /// elements
41+ /// <c>[a b c d e f]</c>
42+ /// . It can represent any linear transformation from one coordinate system to
43+ /// another. Here the most common transformations:
44+ /// <list type="bullet">
45+ /// <item><description>Translations shall be specified as
46+ /// <c>[1 0 0 1 Tx Ty]</c>
47+ /// , where
48+ /// <c>Tx</c>
49+ /// and
50+ /// <c>Ty</c>
51+ /// shall be the
52+ /// distances to translate the origin of the coordinate system in the horizontal and vertical dimensions, respectively.
53+ /// </description></item>
54+ /// <item><description>Scaling shall be obtained by
55+ /// <c>[Sx 0 0 Sy 0 0]</c>
56+ /// . This scales the coordinates so that 1 unit in the
57+ /// horizontal and vertical dimensions of the new coordinate system is the same size as
58+ /// <c>Sx</c>
59+ /// and
60+ /// <c>Sy</c>
61+ /// units,
62+ /// respectively, in the previous coordinate system.
63+ /// </description></item>
64+ /// <item><description>Rotations shall be produced by
65+ /// <c>[Rc Rs -Rs Rc 0 0]</c>
66+ /// , where
67+ /// <c>Rc = cos(q)</c>
68+ /// and
69+ /// <c>Rs = sin(q)</c>
70+ /// which has the effect of rotating the coordinate system axes by an angle
71+ /// <c>q</c>
72+ /// counterclockwise.
73+ /// </description></item>
74+ /// <item><description>Skew shall be specified by
75+ /// <c>[1 Wx Wy 1 0 0]</c>
76+ /// , where
77+ /// <c>Wx = tan(a)</c>
78+ /// and
79+ /// <c>Wy = tan(b)</c>
80+ /// which
81+ /// skews the x-axis by an angle
82+ /// <c>a</c>
83+ /// and the y-axis by an angle
84+ /// <c>b</c>.
85+ /// </description></item>
86+ /// </list>
87+ /// <para />
88+ /// For more information see PDF Specification ISO 32000-1 section 8.3.
89+ /// </remarks>
3190 public class Matrix {
32- /// <summary>the row=1, col=1 position ('a') in the matrix.</summary>
91+ /// <summary>The row=1, col=1 position ('a') in the matrix.</summary>
3392 public const int I11 = 0 ;
3493
35- /// <summary>the row=1, col=2 position ('b') in the matrix.</summary>
94+ /// <summary>The row=1, col=2 position ('b') in the matrix.</summary>
3695 public const int I12 = 1 ;
3796
38- /// <summary>the row=1, col=3 position (always 0 for 2-D ) in the matrix.</summary>
97+ /// <summary>The row=1, col=3 position (always 0 for 2D ) in the matrix.</summary>
3998 public const int I13 = 2 ;
4099
41- /// <summary>the row=2, col=1 position ('c') in the matrix.</summary>
100+ /// <summary>The row=2, col=1 position ('c') in the matrix.</summary>
42101 public const int I21 = 3 ;
43102
44- /// <summary>the row=2, col=2 position ('d') in the matrix.</summary>
103+ /// <summary>The row=2, col=2 position ('d') in the matrix.</summary>
45104 public const int I22 = 4 ;
46105
47- /// <summary>the row=2, col=3 position (always 0 for 2-D ) in the matrix.</summary>
106+ /// <summary>The row=2, col=3 position (always 0 for 2D ) in the matrix.</summary>
48107 public const int I23 = 5 ;
49108
50- /// <summary>the row=3, col=1 ('e', or X translation) position in the matrix.</summary>
109+ /// <summary>The row=3, col=1 ('e', or X translation) position in the matrix.</summary>
51110 public const int I31 = 6 ;
52111
53- /// <summary>the row=3, col=2 ('f', or Y translation) position in the matrix.</summary>
112+ /// <summary>The row=3, col=2 ('f', or Y translation) position in the matrix.</summary>
54113 public const int I32 = 7 ;
55114
56- /// <summary>the row=3, col=3 position (always 1 for 2-D ) in the matrix.</summary>
115+ /// <summary>The row=3, col=3 position (always 1 for 2D ) in the matrix.</summary>
57116 public const int I33 = 8 ;
58117
59118 /// <summary>The values inside the matrix (the identity matrix by default).</summary>
60119 /// <remarks>
61120 /// The values inside the matrix (the identity matrix by default).
62121 /// <para />
63- /// For reference, the indeces are as follows:
122+ /// For reference, the indexes are as follows:
64123 /// <br />I11 I12 I13
65124 /// <br />I21 I22 I23
66125 /// <br />I31 I32 I33
67126 /// </remarks>
68127 private readonly float [ ] vals = new float [ ] { 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 } ;
69128
70- /// <summary>constructs a new Matrix with identity.</summary>
129+ /// <summary>Constructs a new Matrix with identity.</summary>
71130 public Matrix ( ) {
72131 }
73132
@@ -144,7 +203,7 @@ public virtual float Get(int index) {
144203 /// <summary>multiplies this matrix by 'b' and returns the result.</summary>
145204 /// <remarks>
146205 /// multiplies this matrix by 'b' and returns the result.
147- /// See http://en.wikipedia.org/wiki/Matrix_multiplication
206+ /// See <a href=" http://en.wikipedia.org/wiki/matrix_multiplication"> Matrix_multiplication</a>
148207 /// </remarks>
149208 /// <param name="by">The matrix to multiply by</param>
150209 /// <returns>the resulting matrix</returns>
0 commit comments