Skip to content

Commit cfbb732

Browse files
committed
chore: format
1 parent 62f6c7b commit cfbb732

28 files changed

+445
-444
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"semi": false,
33
"singleQuote": true,
4-
"printWidth": 120
4+
"printWidth": 120,
5+
"trailingComma": "none"
56
}

r2/Rect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class Rect {
4141
new Point(this.x.lo, this.y.lo),
4242
new Point(this.x.hi, this.y.lo),
4343
new Point(this.x.hi, this.y.hi),
44-
new Point(this.x.lo, this.y.hi),
44+
new Point(this.x.lo, this.y.hi)
4545
]
4646
}
4747

@@ -230,7 +230,7 @@ export class Rect {
230230
static fromCenterSize(center: Point, size: Point): Rect {
231231
return new Rect(
232232
new Interval(center.x - size.x / 2, center.x + size.x / 2),
233-
new Interval(center.y - size.y / 2, center.y + size.y / 2),
233+
new Interval(center.y - size.y / 2, center.y + size.y / 2)
234234
)
235235
}
236236

r2/Rect_test.ts

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ describe('r2.Rect', () => {
2424
test('constructors', (t) => {
2525
ok(
2626
Rect.fromCenterSize(new Point(0.3, 0.5), new Point(0.2, 0.4)).approxEqual(
27-
Rect.fromPoints(new Point(0.2, 0.3), new Point(0.4, 0.7)),
28-
),
27+
Rect.fromPoints(new Point(0.2, 0.3), new Point(0.4, 0.7))
28+
)
2929
)
3030
ok(
3131
Rect.fromCenterSize(new Point(1, 0.1), new Point(0, 2)).approxEqual(
32-
Rect.fromPoints(new Point(1, -0.9), new Point(1, 1.1)),
33-
),
32+
Rect.fromPoints(new Point(1, -0.9), new Point(1, 1.1))
33+
)
3434
)
3535
ok(
3636
Rect.fromPoints(new Point(0.1, 0), new Point(0.25, 1)).approxEqual(
37-
Rect.fromPoints(new Point(0.1, 0), new Point(0.25, 1)),
38-
),
37+
Rect.fromPoints(new Point(0.1, 0), new Point(0.25, 1))
38+
)
3939
)
4040
ok(
4141
Rect.fromPoints(new Point(0.15, 0.3), new Point(0.35, 0.9)).approxEqual(
42-
Rect.fromPoints(new Point(0.15, 0.9), new Point(0.35, 0.3)),
43-
),
42+
Rect.fromPoints(new Point(0.15, 0.9), new Point(0.35, 0.3))
43+
)
4444
)
4545
ok(
4646
Rect.fromPoints(new Point(0.12, 0), new Point(0.83, 0.5)).approxEqual(
47-
Rect.fromPoints(new Point(0.83, 0), new Point(0.12, 0.5)),
48-
),
47+
Rect.fromPoints(new Point(0.83, 0), new Point(0.12, 0.5))
48+
)
4949
)
5050
})
5151

@@ -88,18 +88,18 @@ describe('r2.Rect', () => {
8888
ok(!RECT.contains(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.7, 0.25))))
8989
ok(
9090
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.1, 0.3)).contains(
91-
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8)),
92-
),
91+
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8))
92+
)
9393
)
9494
ok(
9595
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.4, 0.5)).contains(
96-
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1)),
97-
),
96+
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1))
97+
)
9898
)
9999
ok(
100100
!Rect.fromPoints(new Point(0.0, 0.0), new Point(0.1, 0.3)).contains(
101-
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4)),
102-
),
101+
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4))
102+
)
103103
)
104104
})
105105

@@ -112,18 +112,18 @@ describe('r2.Rect', () => {
112112
ok(!RECT.interiorContains(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.7, 0.25))))
113113
ok(
114114
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.1, 0.3)).interiorContains(
115-
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8)),
116-
),
115+
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8))
116+
)
117117
)
118118
ok(
119119
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.4, 0.5)).interiorContains(
120-
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1)),
121-
),
120+
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1))
121+
)
122122
)
123123
ok(
124124
!Rect.fromPoints(new Point(0.0, 0.0), new Point(0.1, 0.3)).interiorContains(
125-
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4)),
126-
),
125+
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4))
126+
)
127127
)
128128
})
129129

@@ -136,18 +136,18 @@ describe('r2.Rect', () => {
136136
ok(RECT.intersects(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.7, 0.25))))
137137
ok(
138138
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.1, 0.3)).intersects(
139-
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8)),
140-
),
139+
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8))
140+
)
141141
)
142142
ok(
143143
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.4, 0.5)).intersects(
144-
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1)),
145-
),
144+
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1))
145+
)
146146
)
147147
ok(
148148
!Rect.fromPoints(new Point(0.0, 0.0), new Point(0.1, 0.3)).intersects(
149-
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4)),
150-
),
149+
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4))
150+
)
151151
)
152152
})
153153

@@ -160,18 +160,18 @@ describe('r2.Rect', () => {
160160
ok(!RECT.interiorIntersects(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.7, 0.25))))
161161
ok(
162162
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.1, 0.3)).interiorIntersects(
163-
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8)),
164-
),
163+
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8))
164+
)
165165
)
166166
ok(
167167
!Rect.fromPoints(new Point(0.1, 0.2), new Point(0.4, 0.5)).interiorIntersects(
168-
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1)),
169-
),
168+
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1))
169+
)
170170
)
171171
ok(
172172
!Rect.fromPoints(new Point(0.0, 0.0), new Point(0.1, 0.3)).interiorIntersects(
173-
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4)),
174-
),
173+
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4))
174+
)
175175
)
176176
})
177177

@@ -181,33 +181,33 @@ describe('r2.Rect', () => {
181181
deepEqual(RECT.union(RECT_NE), RECT)
182182
deepEqual(
183183
RECT.union(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.75, 0.3))),
184-
Rect.fromPoints(new Point(0, 0.1), new Point(0.75, 0.75)),
184+
Rect.fromPoints(new Point(0, 0.1), new Point(0.75, 0.75))
185185
)
186186
deepEqual(
187187
RECT.union(Rect.fromPoints(new Point(0.5, 0.1), new Point(0.7, 0.3))),
188-
Rect.fromPoints(new Point(0, 0.1), new Point(0.7, 0.75)),
188+
Rect.fromPoints(new Point(0, 0.1), new Point(0.7, 0.75))
189189
)
190190
deepEqual(
191191
RECT.union(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.7, 0.25))),
192-
Rect.fromPoints(new Point(0, 0.1), new Point(0.7, 0.75)),
192+
Rect.fromPoints(new Point(0, 0.1), new Point(0.7, 0.75))
193193
)
194194
deepEqual(
195195
Rect.fromPoints(new Point(0.1, 0.2), new Point(0.1, 0.3)).union(
196-
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8)),
196+
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8))
197197
),
198-
Rect.fromPoints(new Point(0.1, 0.2), new Point(0.2, 0.8)),
198+
Rect.fromPoints(new Point(0.1, 0.2), new Point(0.2, 0.8))
199199
)
200200
deepEqual(
201201
Rect.fromPoints(new Point(0.1, 0.2), new Point(0.4, 0.5)).union(
202-
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1)),
202+
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1))
203203
),
204-
Rect.fromPoints(new Point(0, 0), new Point(0.4, 0.5)),
204+
Rect.fromPoints(new Point(0, 0), new Point(0.4, 0.5))
205205
)
206206
deepEqual(
207207
Rect.fromPoints(new Point(0.0, 0.0), new Point(0.1, 0.3)).union(
208-
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4)),
208+
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4))
209209
),
210-
Rect.fromPoints(new Point(0, 0), new Point(0.3, 0.4)),
210+
Rect.fromPoints(new Point(0, 0), new Point(0.3, 0.4))
211211
)
212212
})
213213

@@ -217,33 +217,33 @@ describe('r2.Rect', () => {
217217
deepEqual(RECT.intersection(RECT_NE), RECT_NE)
218218
deepEqual(
219219
RECT.intersection(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.75, 0.3))),
220-
Rect.fromPoints(new Point(0.45, 0.25), new Point(0.5, 0.3)),
220+
Rect.fromPoints(new Point(0.45, 0.25), new Point(0.5, 0.3))
221221
)
222222
deepEqual(
223223
RECT.intersection(Rect.fromPoints(new Point(0.5, 0.1), new Point(0.7, 0.3))),
224-
Rect.fromPoints(new Point(0.5, 0.25), new Point(0.5, 0.3)),
224+
Rect.fromPoints(new Point(0.5, 0.25), new Point(0.5, 0.3))
225225
)
226226
deepEqual(
227227
RECT.intersection(Rect.fromPoints(new Point(0.45, 0.1), new Point(0.7, 0.25))),
228-
Rect.fromPoints(new Point(0.45, 0.25), new Point(0.5, 0.25)),
228+
Rect.fromPoints(new Point(0.45, 0.25), new Point(0.5, 0.25))
229229
)
230230
deepEqual(
231231
Rect.fromPoints(new Point(0.1, 0.2), new Point(0.1, 0.3)).intersection(
232-
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8)),
232+
Rect.fromPoints(new Point(0.15, 0.7), new Point(0.2, 0.8))
233233
),
234-
EMPTY,
234+
EMPTY
235235
)
236236
deepEqual(
237237
Rect.fromPoints(new Point(0.1, 0.2), new Point(0.4, 0.5)).intersection(
238-
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1)),
238+
Rect.fromPoints(new Point(0, 0), new Point(0.2, 0.1))
239239
),
240-
EMPTY,
240+
EMPTY
241241
)
242242
deepEqual(
243243
Rect.fromPoints(new Point(0.0, 0.0), new Point(0.1, 0.3)).intersection(
244-
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4)),
244+
Rect.fromPoints(new Point(0.2, 0.1), new Point(0.3, 0.4))
245245
),
246-
EMPTY,
246+
EMPTY
247247
)
248248
})
249249

@@ -282,17 +282,17 @@ describe('r2.Rect', () => {
282282
ok(
283283
Rect.fromPoints(new Point(0.2, 0.4), new Point(0.3, 0.7))
284284
.expanded(new Point(0.1, 0.3))
285-
.approxEqual(Rect.fromPoints(new Point(0.1, 0.1), new Point(0.4, 1.0))),
285+
.approxEqual(Rect.fromPoints(new Point(0.1, 0.1), new Point(0.4, 1.0)))
286286
)
287287
ok(
288288
Rect.fromPoints(new Point(0.2, 0.4), new Point(0.3, 0.7))
289289
.expanded(new Point(0.1, -0.1))
290-
.approxEqual(Rect.fromPoints(new Point(0.1, 0.5), new Point(0.4, 0.6))),
290+
.approxEqual(Rect.fromPoints(new Point(0.1, 0.5), new Point(0.4, 0.6)))
291291
)
292292
ok(
293293
Rect.fromPoints(new Point(0.2, 0.4), new Point(0.3, 0.7))
294294
.expanded(new Point(0.1, 0.1))
295-
.approxEqual(Rect.fromPoints(new Point(0.1, 0.3), new Point(0.4, 0.8))),
295+
.approxEqual(Rect.fromPoints(new Point(0.1, 0.3), new Point(0.4, 0.8)))
296296
)
297297
})
298298
})

r3/PreciseVector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class PreciseVector {
117117
return new PreciseVector(
118118
this.y.mul(ov.z).sub(this.z.mul(ov.y)),
119119
this.z.mul(ov.x).sub(this.x.mul(ov.z)),
120-
this.x.mul(ov.y).sub(this.y.mul(ov.x)),
120+
this.x.mul(ov.y).sub(this.y.mul(ov.x))
121121
)
122122
}
123123

0 commit comments

Comments
 (0)