Created
November 28, 2016 05:35
-
-
Save taikomatsu/8c384492ccc0efbc4da8d23420b9b560 to your computer and use it in GitHub Desktop.
extend curve (vex)
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
// curveの先端を接線(というか隣のポイントとの差分)を使って伸ばす | |
vector p0 = point(0, "P", 0); | |
vector p1 = point(0, "P", 1); | |
vector np0 = point(0, "P", i@numpt-1); | |
vector np1 = point(0, "P", i@numpt-2); | |
vector tan_in = normalize(p0-p1); | |
vector tan_out = normalize(np0 - np1); | |
float ext = ch("ext"); | |
addpoint(0, p0+tan_in*ext); | |
addpoint(0, np0+tan_out*ext); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment