geomerative 1.1.0-java → 2.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.mvn/extensions.xml +1 -1
  4. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  5. data/CHANGELOG.md +3 -0
  6. data/COPYING.md +1 -1
  7. data/README.md +0 -1
  8. data/Rakefile +2 -15
  9. data/docs/_includes/header.html +6 -6
  10. data/docs/_includes/icon-github.svg +3 -1
  11. data/docs/_includes/icon-twitter.svg +3 -1
  12. data/docs/_includes/navigation.html +18 -18
  13. data/docs/_sass/_base.scss +79 -79
  14. data/docs/_sass/_layout.scss +137 -137
  15. data/docs/_sass/_syntax-highlighting.scss +64 -64
  16. data/docs/index.html +18 -18
  17. data/examples/data/bot1.svg +1 -1
  18. data/examples/data/lion.svg +156 -156
  19. data/examples/data/ruby.svg +1 -1
  20. data/geomerative.gemspec +1 -2
  21. data/lib/geomerative/version.rb +1 -1
  22. data/mvnw +234 -0
  23. data/mvnw.cmd +145 -0
  24. data/pom.rb +14 -13
  25. data/pom.xml +14 -13
  26. data/src/geomerative/FastRClip.java +2149 -2156
  27. data/src/geomerative/RClip.java +2237 -2539
  28. data/src/geomerative/RClosest.java +33 -31
  29. data/src/geomerative/RCommand.java +1750 -1758
  30. data/src/geomerative/RContour.java +290 -292
  31. data/src/geomerative/RFont.java +277 -246
  32. data/src/geomerative/RG.java +722 -727
  33. data/src/geomerative/RGeomElem.java +967 -960
  34. data/src/geomerative/RGroup.java +508 -467
  35. data/src/geomerative/RMatrix.java +304 -289
  36. data/src/geomerative/RMesh.java +241 -229
  37. data/src/geomerative/RPath.java +924 -925
  38. data/src/geomerative/RPoint.java +391 -391
  39. data/src/geomerative/RPolygon.java +998 -988
  40. data/src/geomerative/RRectangle.java +43 -52
  41. data/src/geomerative/RSVG.java +480 -516
  42. data/src/geomerative/RShape.java +1767 -1777
  43. data/src/geomerative/RStrip.java +173 -176
  44. data/src/geomerative/RStyle.java +197 -194
  45. data/src/org/apache/batik/svggen/font/Font.java +141 -142
  46. data/src/org/apache/batik/svggen/font/Glyph.java +102 -71
  47. data/src/org/apache/batik/svggen/font/Point.java +12 -12
  48. data/src/org/apache/batik/svggen/font/RandomAccessFileEmulator.java +14 -12
  49. data/src/org/apache/batik/svggen/font/table/ClassDef.java +12 -12
  50. data/src/org/apache/batik/svggen/font/table/ClassDefFormat1.java +27 -24
  51. data/src/org/apache/batik/svggen/font/table/ClassDefFormat2.java +20 -17
  52. data/src/org/apache/batik/svggen/font/table/CmapFormat.java +43 -43
  53. data/src/org/apache/batik/svggen/font/table/CmapFormat0.java +33 -26
  54. data/src/org/apache/batik/svggen/font/table/CmapFormat2.java +25 -20
  55. data/src/org/apache/batik/svggen/font/table/CmapFormat4.java +106 -96
  56. data/src/org/apache/batik/svggen/font/table/CmapFormat6.java +36 -32
  57. data/src/org/apache/batik/svggen/font/table/CmapIndexEntry.java +69 -49
  58. data/src/org/apache/batik/svggen/font/table/CmapTable.java +50 -50
  59. data/src/org/apache/batik/svggen/font/table/Coverage.java +19 -19
  60. data/src/org/apache/batik/svggen/font/table/CoverageFormat1.java +30 -27
  61. data/src/org/apache/batik/svggen/font/table/CoverageFormat2.java +26 -24
  62. data/src/org/apache/batik/svggen/font/table/CvtTable.java +16 -16
  63. data/src/org/apache/batik/svggen/font/table/Device.java +32 -32
  64. data/src/org/apache/batik/svggen/font/table/DirectoryEntry.java +39 -39
  65. data/src/org/apache/batik/svggen/font/table/Feature.java +26 -23
  66. data/src/org/apache/batik/svggen/font/table/FeatureList.java +37 -35
  67. data/src/org/apache/batik/svggen/font/table/FeatureRecord.java +22 -22
  68. data/src/org/apache/batik/svggen/font/table/FeatureTags.java +4 -3
  69. data/src/org/apache/batik/svggen/font/table/FpgmTable.java +9 -9
  70. data/src/org/apache/batik/svggen/font/table/GlyfCompositeComp.java +134 -132
  71. data/src/org/apache/batik/svggen/font/table/GlyfCompositeDescript.java +123 -122
  72. data/src/org/apache/batik/svggen/font/table/GlyfDescript.java +44 -44
  73. data/src/org/apache/batik/svggen/font/table/GlyfSimpleDescript.java +110 -109
  74. data/src/org/apache/batik/svggen/font/table/GlyfTable.java +46 -46
  75. data/src/org/apache/batik/svggen/font/table/GlyphDescription.java +25 -13
  76. data/src/org/apache/batik/svggen/font/table/GposTable.java +26 -23
  77. data/src/org/apache/batik/svggen/font/table/GsubTable.java +85 -82
  78. data/src/org/apache/batik/svggen/font/table/HeadTable.java +131 -131
  79. data/src/org/apache/batik/svggen/font/table/HheaTable.java +80 -80
  80. data/src/org/apache/batik/svggen/font/table/HmtxTable.java +50 -49
  81. data/src/org/apache/batik/svggen/font/table/KernSubtable.java +29 -27
  82. data/src/org/apache/batik/svggen/font/table/KernSubtableFormat0.java +35 -32
  83. data/src/org/apache/batik/svggen/font/table/KernSubtableFormat2.java +28 -26
  84. data/src/org/apache/batik/svggen/font/table/KernTable.java +36 -31
  85. data/src/org/apache/batik/svggen/font/table/KerningPair.java +27 -23
  86. data/src/org/apache/batik/svggen/font/table/LangSys.java +28 -26
  87. data/src/org/apache/batik/svggen/font/table/LangSysRecord.java +22 -22
  88. data/src/org/apache/batik/svggen/font/table/Ligature.java +24 -24
  89. data/src/org/apache/batik/svggen/font/table/LigatureSet.java +24 -24
  90. data/src/org/apache/batik/svggen/font/table/LigatureSubst.java +9 -9
  91. data/src/org/apache/batik/svggen/font/table/LigatureSubstFormat1.java +30 -30
  92. data/src/org/apache/batik/svggen/font/table/LocaTable.java +37 -37
  93. data/src/org/apache/batik/svggen/font/table/Lookup.java +41 -40
  94. data/src/org/apache/batik/svggen/font/table/LookupList.java +34 -34
  95. data/src/org/apache/batik/svggen/font/table/LookupSubtableFactory.java +7 -5
  96. data/src/org/apache/batik/svggen/font/table/MaxpTable.java +96 -96
  97. data/src/org/apache/batik/svggen/font/table/NameRecord.java +64 -65
  98. data/src/org/apache/batik/svggen/font/table/NameTable.java +33 -33
  99. data/src/org/apache/batik/svggen/font/table/Os2Table.java +196 -196
  100. data/src/org/apache/batik/svggen/font/table/Panose.java +14 -12
  101. data/src/org/apache/batik/svggen/font/table/PostTable.java +338 -338
  102. data/src/org/apache/batik/svggen/font/table/PrepTable.java +9 -9
  103. data/src/org/apache/batik/svggen/font/table/Program.java +15 -15
  104. data/src/org/apache/batik/svggen/font/table/RangeRecord.java +26 -25
  105. data/src/org/apache/batik/svggen/font/table/Script.java +38 -38
  106. data/src/org/apache/batik/svggen/font/table/ScriptList.java +42 -42
  107. data/src/org/apache/batik/svggen/font/table/ScriptRecord.java +22 -22
  108. data/src/org/apache/batik/svggen/font/table/ScriptTags.java +2 -1
  109. data/src/org/apache/batik/svggen/font/table/SingleSubst.java +15 -16
  110. data/src/org/apache/batik/svggen/font/table/SingleSubstFormat1.java +33 -33
  111. data/src/org/apache/batik/svggen/font/table/SingleSubstFormat2.java +32 -32
  112. data/src/org/apache/batik/svggen/font/table/Table.java +171 -170
  113. data/src/org/apache/batik/svggen/font/table/TableDirectory.java +55 -55
  114. data/src/org/apache/batik/svggen/font/table/TableFactory.java +92 -93
  115. metadata +10 -11
  116. data/.travis.yml +0 -9
@@ -1,397 +1,412 @@
1
1
  /**
2
- Copyright 2004-2008 Ricard Marxer <email@ricardmarxer.com>
3
-
4
- This file is part of Geomerative.
5
-
6
- Geomerative is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation, either version 3 of the License, or
9
- (at your option) any later version.
10
-
11
- Geomerative is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with Geomerative. If not, see <http://www.gnu.org/licenses/>.
18
- */
19
-
20
- package geomerative ;
2
+ * Copyright 2004-2008 Ricard Marxer <email@ricardmarxer.com>
3
+ *
4
+ * This file is part of Geomerative.
5
+ *
6
+ * Geomerative is free software: you can redistribute it and/or modify it under
7
+ * the terms of the GNU General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later
9
+ * version.
10
+ *
11
+ * Geomerative is distributed in the hope that it will be useful, but WITHOUT
12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
+ * details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License along with
17
+ * Geomerative. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+ package geomerative;
21
20
 
22
21
  import processing.core.PApplet;
23
22
 
24
23
  /**
25
- * RMatrix is a very simple interface for creating, holding 3x3 matrices with the most common 2D affine transformations such as translation, rotation, scaling and shearing. We only have access to the first to rows of the matrix the last row is considered a constant 0, 0, 1 in order to have better performance.
26
- * @eexample RMatrix
27
- * @usage Geometry
28
- * @extended
24
+ * RMatrix is a very simple interface for creating, holding 3x3 matrices with
25
+ * the most common 2D affine transformations such as translation, rotation,
26
+ * scaling and shearing. We only have access to the first to rows of the matrix
27
+ * the last row is considered a constant 0, 0, 1 in order to have better
28
+ * performance.
29
+ *
30
+ RMatrix
31
+ * Geometry
32
+
29
33
  */
30
- public class RMatrix
31
- {
32
-
34
+ public class RMatrix {
35
+
33
36
  float m00 = 1F;
34
37
  float m01 = 0F;
35
38
  float m02 = 0F;
36
-
39
+
37
40
  float m10 = 0F;
38
41
  float m11 = 1F;
39
42
  float m12 = 0F;
40
-
43
+
41
44
  float m20 = 0F;
42
45
  float m21 = 0F;
43
46
  float m22 = 1F;
44
-
47
+
45
48
  /**
46
49
  * Create a new matrix given the coefficients.
47
- * @eexample RMatrix
48
- * @param m00 coefficient 00 of the matrix
49
- * @param m01 coefficient 01 of the matrix
50
- * @param m02 coefficient 02 of the matrix
51
- * @param m10 coefficient 10 of the matrix
52
- * @param m11 coefficient 11 of the matrix
53
- * @param m12 coefficient 12 of the matrix
54
- * @usage Geometry
55
- * @related apply ( )
56
- * @related translate ( )
57
- * @related rotate ( )
58
- * @related scale ( )
59
- * @related shear ( )
50
+ *
51
+ RMatrix
52
+ * @param m00 coefficient 00 of the matrix
53
+ * @param m01 coefficient 01 of the matrix
54
+ * @param m02 coefficient 02 of the matrix
55
+ * @param m10 coefficient 10 of the matrix
56
+ * @param m11 coefficient 11 of the matrix
57
+ * @param m12 coefficient 12 of the matrix
58
+ * Geometry
59
+ * apply ( )
60
+ * translate ( )
61
+ * rotate ( )
62
+ * scale ( )
63
+ * shear ( )
60
64
  */
61
65
  public RMatrix(float m00, float m01, float m02,
62
- float m10, float m11, float m12)
63
- {
66
+ float m10, float m11, float m12) {
64
67
  set(m00, m01, m02,
65
- m10, m11, m12);
68
+ m10, m11, m12);
66
69
  }
67
70
 
68
71
  /**
69
72
  * Create a new identity matrix.
70
- * @eexample RMatrix
71
- * @usage Geometry
72
- * @related apply ( )
73
- * @related translate ( )
74
- * @related rotate ( )
75
- * @related scale ( )
76
- * @related shear ( )
73
+ *
74
+ RMatrix
75
+ * Geometry
76
+ * apply ( )
77
+ * translate ( )
78
+ * rotate ( )
79
+ * scale ( )
80
+ * shear ( )
77
81
  */
78
- public RMatrix()
79
- {
82
+ public RMatrix() {
80
83
  m00 = 1F;
81
84
  m01 = 0F;
82
85
  m02 = 0F;
83
-
86
+
84
87
  m10 = 0F;
85
88
  m11 = 1F;
86
89
  m12 = 0F;
87
- }
88
-
90
+ }
91
+
89
92
  /**
90
93
  * Copy a matrix.
91
- * @eexample RMatrix
92
- * @param src source matrix from where to copy the matrix
93
- * @usage Geometry
94
- * @related apply ( )
95
- * @related translate ( )
96
- * @related rotate ( )
97
- * @related scale ( )
98
- * @related shear ( )
94
+ *
95
+ RMatrix
96
+ * @param src source matrix from where to copy the matrix
97
+ * Geometry
98
+ * apply ( )
99
+ * translate ( )
100
+ * rotate ( )
101
+ * scale ( )
102
+ * shear ( )
99
103
  */
100
- public RMatrix(RMatrix src)
101
- {
104
+ public RMatrix(RMatrix src) {
102
105
  set(src.m00, src.m01, src.m02,
103
- src.m10, src.m11, src.m12);
106
+ src.m10, src.m11, src.m12);
104
107
  }
105
-
106
- public RMatrix(String transformationString){
108
+
109
+ public RMatrix(String transformationString) {
107
110
  String[] transfTokens = PApplet.splitTokens(transformationString, ")");
108
-
109
- // Loop through all transformations
110
- for (String transfToken : transfTokens) {
111
- // Check the transformation and the parameters
112
- String[] transf = PApplet.splitTokens(transfToken, "(");
113
- String[] params = PApplet.splitTokens(transf[1], ", ");
114
- float[] fparams = new float[params.length];
115
- for(int j=0; j<params.length; j++){
116
- fparams[j] = PApplet.parseFloat(params[j]);
117
- } transf[0] = PApplet.trim(transf[0]);
118
- switch (transf[0]) {
119
- case "translate":
120
- if(params.length == 1){
121
- this.translate(fparams[0]);
122
-
123
- }else if(params.length == 2){
124
- this.translate(fparams[0], fparams[1]);
125
-
126
- } break;
127
- case "rotate":
128
- if(params.length == 1){
129
- this.rotate(PApplet.radians(fparams[0]));
130
-
131
- }else if(params.length == 3){
132
- this.rotate(PApplet.radians(fparams[0]), fparams[1], fparams[2]);
133
-
134
- } break;
135
- case "scale":
136
- if(params.length == 1){
137
- this.scale(fparams[0]);
138
-
139
- }else if(params.length == 2){
140
- this.scale(fparams[0], fparams[1]);
141
- } break;
142
- case "skewX":
143
- this.skewX(PApplet.radians(fparams[0]));
144
- break;
145
- case "skewY":
146
- this.skewY(PApplet.radians(fparams[0]));
147
- break;
148
- case "matrix":
149
- this.apply(fparams[0], fparams[2], fparams[4], fparams[1], fparams[3], fparams[5]);
150
- break;
151
- default:
152
- throw new RuntimeException("Transformation unknown. '"+ transf[0] +"'");
153
- }
111
+
112
+ // Loop through all transformations
113
+ for (String transfToken : transfTokens) {
114
+ // Check the transformation and the parameters
115
+ String[] transf = PApplet.splitTokens(transfToken, "(");
116
+ String[] params = PApplet.splitTokens(transf[1], ", ");
117
+ float[] fparams = new float[params.length];
118
+ for (int j = 0; j < params.length; j++) {
119
+ fparams[j] = PApplet.parseFloat(params[j]);
120
+ }
121
+ transf[0] = PApplet.trim(transf[0]);
122
+ switch (transf[0]) {
123
+ case "translate":
124
+ if (params.length == 1) {
125
+ this.translate(fparams[0]);
126
+
127
+ } else if (params.length == 2) {
128
+ this.translate(fparams[0], fparams[1]);
129
+
130
+ }
131
+ break;
132
+ case "rotate":
133
+ if (params.length == 1) {
134
+ this.rotate(PApplet.radians(fparams[0]));
135
+
136
+ } else if (params.length == 3) {
137
+ this.rotate(PApplet.radians(fparams[0]), fparams[1], fparams[2]);
138
+
139
+ }
140
+ break;
141
+ case "scale":
142
+ if (params.length == 1) {
143
+ this.scale(fparams[0]);
144
+
145
+ } else if (params.length == 2) {
146
+ this.scale(fparams[0], fparams[1]);
147
+ }
148
+ break;
149
+ case "skewX":
150
+ this.skewX(PApplet.radians(fparams[0]));
151
+ break;
152
+ case "skewY":
153
+ this.skewY(PApplet.radians(fparams[0]));
154
+ break;
155
+ case "matrix":
156
+ this.apply(fparams[0], fparams[2], fparams[4], fparams[1], fparams[3], fparams[5]);
157
+ break;
158
+ default:
159
+ throw new RuntimeException("Transformation unknown. '" + transf[0] + "'");
154
160
  }
161
+ }
155
162
  }
156
-
163
+
157
164
  private void set(float m00, float m01, float m02,
158
- float m10, float m11, float m12)
159
- {
165
+ float m10, float m11, float m12) {
160
166
  this.m00 = m00;
161
167
  this.m01 = m01;
162
168
  this.m02 = m02;
163
-
169
+
164
170
  this.m10 = m10;
165
171
  this.m11 = m11;
166
172
  this.m12 = m12;
167
173
  }
168
-
174
+
169
175
  /**
170
- * Multiply the matrix with another matrix. This is mostly use to chain transformations.
171
- * @eexample RMatrix_apply
172
- * @param n00 coefficient 00 of the matrix to be applied
173
- * @param n01 coefficient 01 of the matrix to be applied
174
- * @param n02 coefficient 02 of the matrix to be applied
175
- * @param n10 coefficient 10 of the matrix to be applied
176
- * @param n11 coefficient 11 of the matrix to be applied
177
- * @param n12 coefficient 12 of the matrix to be applied
178
- * @usage Geometry
179
- * @related translate ( )
180
- * @related rotate ( )
181
- * @related scale ( )
182
- * @related shear ( )
183
- */
176
+ * Multiply the matrix with another matrix. This is mostly use to chain
177
+ * transformations.
178
+ *
179
+ RMatrix_apply
180
+ * @param n00 coefficient 00 of the matrix to be applied
181
+ * @param n01 coefficient 01 of the matrix to be applied
182
+ * @param n02 coefficient 02 of the matrix to be applied
183
+ * @param n10 coefficient 10 of the matrix to be applied
184
+ * @param n11 coefficient 11 of the matrix to be applied
185
+ * @param n12 coefficient 12 of the matrix to be applied
186
+ * Geometry
187
+ * translate ( )
188
+ * rotate ( )
189
+ * scale ( )
190
+ * shear ( )
191
+ */
184
192
  public final void apply(float n00, float n01, float n02,
185
- float n10, float n11, float n12) {
186
-
187
- float r00 = m00*n00 + m01*n10;
188
- float r01 = m00*n01 + m01*n11;
189
- float r02 = m00*n02 + m01*n12 + m02;
190
-
191
- float r10 = m10*n00 + m11*n10;
192
- float r11 = m10*n01 + m11*n11 ;
193
- float r12 = m10*n02 + m11*n12 + m12;
194
-
195
- m00 = r00; m01 = r01; m02 = r02;
196
- m10 = r10; m11 = r11; m12 = r12;
193
+ float n10, float n11, float n12) {
194
+
195
+ float r00 = m00 * n00 + m01 * n10;
196
+ float r01 = m00 * n01 + m01 * n11;
197
+ float r02 = m00 * n02 + m01 * n12 + m02;
198
+
199
+ float r10 = m10 * n00 + m11 * n10;
200
+ float r11 = m10 * n01 + m11 * n11;
201
+ float r12 = m10 * n02 + m11 * n12 + m12;
202
+
203
+ m00 = r00;
204
+ m01 = r01;
205
+ m02 = r02;
206
+ m10 = r10;
207
+ m11 = r11;
208
+ m12 = r12;
197
209
  }
198
210
 
199
211
  /**
200
- * Multiply the matrix with another matrix. This is mostly use to chain transformations.
201
- * @eexample RMatrix_apply
202
- * @param rhs right hand side matrix
203
- * @usage Geometry
204
- * @related translate ( )
205
- * @related rotate ( )
206
- * @related scale ( )
207
- * @related shear ( )
212
+ * Multiply the matrix with another matrix. This is mostly use to chain
213
+ * transformations.
214
+ *
215
+ RMatrix_apply
216
+ * @param rhs right hand side matrix
217
+ * Geometry
218
+ * translate ( )
219
+ * rotate ( )
220
+ * scale ( )
221
+ * shear ( )
208
222
  */
209
223
  public void apply(RMatrix rhs) {
210
224
  apply(rhs.m00, rhs.m01, rhs.m02,
211
- rhs.m10, rhs.m11, rhs.m12);
212
- }
225
+ rhs.m10, rhs.m11, rhs.m12);
226
+ }
213
227
 
214
228
  /**
215
229
  * Apply a translation to the matrix, given the coordinates.
216
- * @eexample RMatrix_translate
217
- * @param tx x coordinate translation
218
- * @param ty y coordinate translation
219
- * @usage Geometry
220
- * @related rotate ( )
221
- * @related scale ( )
222
- * @related shear ( )
230
+ *
231
+ RMatrix_translate
232
+ * @param tx x coordinate translation
233
+ * @param ty y coordinate translation
234
+ * Geometry
235
+ * rotate ( )
236
+ * scale ( )
237
+ * shear ( )
223
238
  */
224
- public final void translate(float tx, float ty)
225
- {
239
+ public final void translate(float tx, float ty) {
226
240
  apply(1, 0, tx, 0, 1, ty);
227
241
  }
228
242
 
229
- public final void translate(float tx)
230
- {
243
+ public final void translate(float tx) {
231
244
  translate(tx, 0);
232
245
  }
233
-
246
+
234
247
  /**
235
248
  * Apply a translation to the matrix, given a point.
236
- * @eexample RMatrix_translate
237
- * @param t vector translation
238
- * @usage Geometry
239
- * @related rotate ( )
240
- * @related scale ( )
241
- * @related shear ( )
249
+ *
250
+ RMatrix_translate
251
+ * @param t vector translation
252
+ * Geometry
253
+ * rotate ( )
254
+ * scale ( )
255
+ * shear ( )
242
256
  */
243
- public void translate(RPoint t)
244
- {
257
+ public void translate(RPoint t) {
245
258
  translate(t.x, t.y);
246
259
  }
247
-
260
+
248
261
  /**
249
- * Apply a rotation to the matrix, given an angle and optionally a rotation center.
250
- * @eexample RPoint_rotate
251
- * @usage Geometry
252
- * @param angle the angle of rotation to be applied
253
- * @param vx the x coordinate of the center of rotation
254
- * @param vy the y coordinate of the center of rotation
255
- * @related transform ( )
256
- * @related translate ( )
257
- * @related scale ( )
258
- */
259
- public final void rotate(float angle, float vx, float vy)
260
- {
261
- translate(vx,vy);
262
+ * Apply a rotation to the matrix, given an angle and optionally a rotation
263
+ * center.
264
+ *
265
+ RPoint_rotate
266
+ * Geometry
267
+ * @param angle the angle of rotation to be applied
268
+ * @param vx the x coordinate of the center of rotation
269
+ * @param vy the y coordinate of the center of rotation
270
+ * transform ( )
271
+ * translate ( )
272
+ * scale ( )
273
+ */
274
+ public final void rotate(float angle, float vx, float vy) {
275
+ translate(vx, vy);
262
276
  rotate(angle);
263
- translate(-vx,-vy);
277
+ translate(-vx, -vy);
264
278
  }
265
279
 
266
- public final void rotate(float angle)
267
- {
268
- float c = (float)Math.cos(angle);
269
- float s = (float)Math.sin(angle);
270
- apply(c, -s, 0, s, c, 0);
280
+ public final void rotate(float angle) {
281
+ float c = (float) Math.cos(angle);
282
+ float s = (float) Math.sin(angle);
283
+ apply(c, -s, 0, s, c, 0);
271
284
  }
272
285
 
273
286
  /**
274
- * Apply a rotation to the matrix, given an angle and optionally a rotation center.
275
- * @eexample RPoint_rotate
276
- * @usage Geometry
277
- * @param angle the angle of rotation to be applied
278
- * @param v the position vector of the center of rotation
279
- * @related transform ( )
280
- * @related translate ( )
281
- * @related scale ( )
282
- */
283
- public void rotate(float angle, RPoint v)
284
- {
287
+ * Apply a rotation to the matrix, given an angle and optionally a rotation
288
+ * center.
289
+ *
290
+ RPoint_rotate
291
+ * Geometry
292
+ * @param angle the angle of rotation to be applied
293
+ * @param v the position vector of the center of rotation
294
+ * transform ( )
295
+ * translate ( )
296
+ * scale ( )
297
+ */
298
+ public void rotate(float angle, RPoint v) {
285
299
  rotate(angle, v.x, v.y);
286
300
  }
287
-
301
+
288
302
  /**
289
- * Apply a scale to the matrix, given scaling factors and optionally a scaling center.
290
- * @eexample RPoint_scale
291
- * @usage Geometry
292
- * @param sx the scaling coefficient over the x axis
293
- * @param sy the scaling coefficient over the y axis
294
- * @param x x coordinate of the position vector of the center of the scaling
295
- * @param y y coordinate of the position vector of the center of the scaling
296
- * @related transform ( )
297
- * @related translate ( )
298
- * @related rotate ( )
303
+ * Apply a scale to the matrix, given scaling factors and optionally a scaling
304
+ * center.
305
+ *
306
+ RPoint_scale
307
+ * Geometry
308
+ * @param sx the scaling coefficient over the x axis
309
+ * @param sy the scaling coefficient over the y axis
310
+ * @param x x coordinate of the position vector of the center of the scaling
311
+ * @param y y coordinate of the position vector of the center of the scaling
312
+ * transform ( )
313
+ * translate ( )
314
+ * rotate ( )
299
315
  */
300
- public void scale(float sx, float sy, float x, float y)
301
- {
302
- translate(x,y);
303
- scale(sx,sy);
304
- translate(-x,-y);
316
+ public void scale(float sx, float sy, float x, float y) {
317
+ translate(x, y);
318
+ scale(sx, sy);
319
+ translate(-x, -y);
305
320
  }
306
321
 
307
- public final void scale(float sx, float sy)
308
- {
309
- apply(sx, 0, 0, 0, sy, 0);
322
+ public final void scale(float sx, float sy) {
323
+ apply(sx, 0, 0, 0, sy, 0);
310
324
  }
311
-
325
+
312
326
  /**
313
- * Apply a scale to the matrix, given scaling factors and optionally a scaling center.
314
- * @eexample RPoint_scale
315
- * @usage Geometry
316
- * @param s the scaling coefficient for a uniform scaling
317
- * @param x x coordinate of the position vector of the center of the scaling
318
- * @param y y coordinate of the position vector of the center of the scaling
319
- * @related transform ( )
320
- * @related translate ( )
321
- * @related rotate ( )
327
+ * Apply a scale to the matrix, given scaling factors and optionally a scaling
328
+ * center.
329
+ *
330
+ RPoint_scale
331
+ * Geometry
332
+ * @param s the scaling coefficient for a uniform scaling
333
+ * @param x x coordinate of the position vector of the center of the scaling
334
+ * @param y y coordinate of the position vector of the center of the scaling
335
+ * transform ( )
336
+ * translate ( )
337
+ * rotate ( )
322
338
  */
323
- public void scale(float s, float x, float y)
324
- {
339
+ public void scale(float s, float x, float y) {
325
340
  scale(s, s, x, y);
326
341
  }
327
-
342
+
328
343
  /**
329
- * Apply a scale to the matrix, given scaling factors and optionally a scaling center.
330
- * @eexample RPoint_scale
331
- * @usage Geometry
332
- * @param sx the scaling coefficient over the x axis
333
- * @param sy the scaling coefficient over the y axis
334
- * @param p the position vector of the center of the scaling
335
- * @related transform ( )
336
- * @related translate ( )
337
- * @related rotate ( )
344
+ * Apply a scale to the matrix, given scaling factors and optionally a scaling
345
+ * center.
346
+ *
347
+ RPoint_scale
348
+ * Geometry
349
+ * @param sx the scaling coefficient over the x axis
350
+ * @param sy the scaling coefficient over the y axis
351
+ * @param p the position vector of the center of the scaling
352
+ * transform ( )
353
+ * translate ( )
354
+ * rotate ( )
338
355
  */
339
- public void scale(float sx, float sy, RPoint p)
340
- {
356
+ public void scale(float sx, float sy, RPoint p) {
341
357
  scale(sx, sy, p.x, p.y);
342
358
  }
343
359
 
344
360
  /**
345
- * Apply a scale to the matrix, given scaling factors and optionally a scaling center.
346
- * @eexample RPoint_scale
347
- * @usage Geometry
348
- * @param s the scaling coefficient for a uniform scaling
349
- * @param p the position vector of the center of the scaling
350
- * @related transform ( )
351
- * @related translate ( )
352
- * @related rotate ( )
353
- */
354
- public void scale(float s, RPoint p)
355
- {
361
+ * Apply a scale to the matrix, given scaling factors and optionally a scaling
362
+ * center.
363
+ *
364
+ RPoint_scale
365
+ * Geometry
366
+ * @param s the scaling coefficient for a uniform scaling
367
+ * @param p the position vector of the center of the scaling
368
+ * transform ( )
369
+ * translate ( )
370
+ * rotate ( )
371
+ */
372
+ public void scale(float s, RPoint p) {
356
373
  scale(s, s, p.x, p.y);
357
374
  }
358
-
359
- public final void scale(float s)
360
- {
375
+
376
+ public final void scale(float s) {
361
377
  scale(s, s);
362
378
  }
363
379
 
364
380
  /**
365
381
  * Use this to apply a skewing to the matrix.
366
- * @eexample RMatrix_skewing
367
- * @param angle skewing angle
368
- * @usage Geometry
369
- * @related rotate ( )
370
- * @related scale ( )
371
- * @related translate ( )
382
+ *
383
+ RMatrix_skewing
384
+ * @param angle skewing angle
385
+ * Geometry
386
+ * rotate ( )
387
+ * scale ( )
388
+ * translate ( )
372
389
  */
373
- public final void skewX(float angle)
374
- {
375
- apply(1, (float)Math.tan(angle), 0, 0, 1, 0);
390
+ public final void skewX(float angle) {
391
+ apply(1, (float) Math.tan(angle), 0, 0, 1, 0);
376
392
  }
377
-
378
- public final void skewY(float angle)
379
- {
380
- apply(1, 0, 0, (float)Math.tan(angle), 1, 0);
393
+
394
+ public final void skewY(float angle) {
395
+ apply(1, 0, 0, (float) Math.tan(angle), 1, 0);
381
396
  }
382
-
397
+
383
398
  /**
384
399
  * Use this to apply a shearing to the matrix.
385
- * @eexample RMatrix_translate
386
- * @param shx x coordinate shearing
387
- * @param shy y coordinate shearing
388
- * @usage Geometry
389
- * @related rotate ( )
390
- * @related scale ( )
391
- * @related translate ( )
400
+ *
401
+ RMatrix_translate
402
+ * @param shx x coordinate shearing
403
+ * @param shy y coordinate shearing
404
+ * Geometry
405
+ * rotate ( )
406
+ * scale ( )
407
+ * translate ( )
392
408
  */
393
- public void shear(float shx, float shy)
394
- {
395
- apply(1, -shx, 0, shy, 1, 0);
409
+ public void shear(float shx, float shy) {
410
+ apply(1, -shx, 0, shy, 1, 0);
396
411
  }
397
412
  }