@altpsyche/maths 0.9.4 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -212,23 +212,51 @@ When the pieces kept will not join into a loop, the operation stops and says how
|
|
|
212
212
|
ends of the run it had are. That happens when an input crosses itself, which these do not take. A
|
|
213
213
|
shape drawn with a gap in it and nothing said about it is the one failure a caller cannot see.
|
|
214
214
|
|
|
215
|
+
## A turn about a point
|
|
216
|
+
|
|
217
|
+
<img src="docs/rotate.svg" width="720" alt="Two panels side by side, each an L-shaped block turned part way round with a dot marking the point it turns about. In the left panel the dot sits at the middle of the block's own box. In the right it sits off to one side, so the block swings round it. A word rides with the block in both panels and stays upright.">
|
|
218
|
+
|
|
219
|
+
`rotate(target, angle)` turns the marks a name reaches, over a span of the timeline. The point it
|
|
220
|
+
turns about is the middle of the box round those marks unless a figure names one, and it is read off
|
|
221
|
+
them as they arrive rather than after the turn has moved them. The box round a turned shape is not the
|
|
222
|
+
turned box, so reading it back afterwards would let the pivot drift and the turn would stop being a
|
|
223
|
+
turn.
|
|
224
|
+
|
|
225
|
+
The left panel takes that default and spins where it stands. The right panel is given a point off to
|
|
226
|
+
one side, so the same shape swings round it instead. The furthest corner of the left shape stays 1.00
|
|
227
|
+
figure units from its pivot at every time and the right one's stays 2.34, which is what makes the two
|
|
228
|
+
read as different motions rather than as the same one twice.
|
|
229
|
+
|
|
230
|
+
A word rides with the shape in both panels and stays upright the whole way round. A mark carries no
|
|
231
|
+
rotation of its own, so turning the words would be work in both painters for a label that is easier to
|
|
232
|
+
read left as it is, which is the same reason a number line takes a direction rather than being turned
|
|
233
|
+
on its side.
|
|
234
|
+
|
|
235
|
+
A turn does not thicken a line. A stroke's width is multiplied by how much the transform stretches a
|
|
236
|
+
length, and a rotation stretches nothing, where `scale` stretches by the factor it grew by.
|
|
237
|
+
|
|
238
|
+
<img src="docs/rotate-strip.svg" width="820" alt="Four frames in two rows, each showing both panels, at nothing, a quarter, a half and three quarters of the way round.">
|
|
239
|
+
|
|
240
|
+
The quarters of the turn. The whole turn is left off the strip because it draws the picture that
|
|
241
|
+
nothing draws: this is the first figure here to declare itself a loop, and `loops(figure)` is the gate
|
|
242
|
+
behind that flag, comparing the marks at the duration against the marks at zero.
|
|
243
|
+
|
|
215
244
|
## The animations
|
|
216
245
|
|
|
217
246
|
`fadeIn`, `fadeOut`, `fadeTo`, `draw`, `morph`, `morphEquation`, `countTo`, `moveBy`, `rotate`,
|
|
218
247
|
`scale`, `growFrom`, `moveAlong`, `indicate`, `flash` and `circumscribe`. A `Timeline` plays them in order, plays several `together`, or
|
|
219
248
|
`stagger`s a row so its parts arrive one after another.
|
|
220
249
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
itself rather than from the points the curve is written from.
|
|
250
|
+
`boundsOf` is the box a turn and a growth are worked about, found from where each piece of the curve
|
|
251
|
+
turns back on itself rather than from the points the curve is written from.
|
|
224
252
|
|
|
225
253
|
`moveAlong` carries a mark along a path at one speed, measured by the path's length. Even steps in a
|
|
226
254
|
curve's own parameter are uneven steps along the curve: a step covers more of it where the curve is
|
|
227
255
|
moving fast, which on a quarter circle is a 6.9% difference between the longest step and the shortest
|
|
228
256
|
and on the demo's own walk is 82%.
|
|
229
257
|
|
|
230
|
-
|
|
231
|
-
|
|
258
|
+
Every picture here is written by `svgMarkup`, which needs no browser, so `npm run demos` regenerates
|
|
259
|
+
all six and a test compares the bytes against the committed files.
|
|
232
260
|
|
|
233
261
|
## What it is built on
|
|
234
262
|
|
package/package.json
CHANGED