FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 715 : curveTangent() todo list submission
Last modified: 2008-01-29 19:09
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
davbol
Assigned To:
fry
Attachment
Type
Created
Size
Actions
curveTangent() diff
patch
2008-01-22 09:12
512 bytes
Description
: Opened: 2008-01-22 09:11
As long as I'm thinking about tangents... I just took derivative of existing curvePoint
equation and dumped it into curveTangent, here's a sample (stolen from the
bezierTangent sample) for the ref page if wanted:
stroke(0);
noFill();
curve(-200, 0, 10, 10, 90, 90, 500, 300);
stroke(255, 102, 0);
int steps = 16;
for (int i = 0; i <= steps; i++) {
float t = i / float(steps);
float x = curvePoint(-200, 10, 90, 500, t);
float y = curvePoint(0, 10, 90, 300, t);
float tx = curveTangent(-200, 10, 90, 500, t);
float ty = curveTangent(0, 10, 90, 300, t);
float a = atan2(ty, tx);
a -= PI/2.0;
line(x, y, cos(a)*8 + x, sin(a)*8 + y);
}
Additional Comment
#1 From davbol 2008-01-22 09:12
edit
]
curveTangent() diff
Additional Comment
#2 From fry 2008-01-29 19:09
oh that's super great, thanks so much!
i've added the patch for 0136.