-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Curve | ||
|
||
## bezier | ||
|
||
## Catmull-Rom | ||
|
||
- uniform | ||
- chordal | ||
- centripetal | ||
|
||
过四个点的曲线(p0,p1,p2,p3)的曲线方程为B(t)=a+b*t+c*t^2+d*t^3 | ||
其切线方程为C(t)=b+2c*t+3*d*t^2 | ||
满足以下条件 | ||
- B(0) = p1 => a = p1 | ||
- C(0) = (p2 - p1) / 2, => b = (P2 - p1) / 2 | ||
- B(1) = p2 => a + b + c + d = p2 | ||
- C(1) = (p3 - p1) / 2 => b + 2c + 3d = (p3 - p1) / 2 | ||
由上面的条件得出 | ||
- a = p1 | ||
- b = (p2 - p1) / 2 | ||
- c = (2p0 - 5p1 + 4p2 - p3) / 2 | ||
- d = (-p0 + 3p1 - 3p2 + p3) / 2 | ||
|
||
[On the Parameterization of Catmull-Rom Curves](http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# GIF | ||
|
||
|
||
- [jsgif: A GIF player in JavaScript](https://slbkbs.org/jsgif/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 压缩 | ||
> js压缩 | ||
## jszip | ||
|
||
```js | ||
new Promise(()=>{ | ||
|
||
}).then(res=>{ | ||
// 字符串 | ||
if (res.byteLength < 100) { | ||
const tmp = JSON.parse(new TextDecoder().decode(new Uint8Array(res))); | ||
} else { | ||
const zip = new JSZip(); | ||
zip.loadAsync(res).then(zip=>{ | ||
let i = 0; | ||
for (const fname in zip.files) { | ||
zip.file(fname).async('arraybuffer').then(img=>{ | ||
const blob = new Blob([img]); | ||
i++; | ||
if (i == 4) { | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
}) | ||
``` |