68 lines
1.1 KiB
Plaintext
68 lines
1.1 KiB
Plaintext
Curves are a transition from one line to another such that a curved line
|
|
emerges.
|
|
For doing so one needs to interpolate between 4 points.
|
|
|
|
curve is a simple curve with linear interpolation twice;
|
|
looks quite curvy anyway
|
|
|
|
smooth is a smoother interpolation with continous derivations at its end
|
|
when continuing with the constant 0 or 1 function
|
|
|
|
f(0) = 0
|
|
f(1) = 1
|
|
f'(0) = 0
|
|
f'(1) = 0
|
|
|
|
f = bx^3+cx^2+dx+e
|
|
f' = 3bx^2 + 2cx + d
|
|
|
|
f(0) = 0 -> e=0
|
|
f(1) = 1 -> b+c+d+e = 1
|
|
f'(0) = 0 -> d = 0
|
|
f'(1) = 0 -> 3b+2c+d = 0
|
|
|
|
b+c = 1
|
|
3b+2c = 0
|
|
|
|
c = 3
|
|
b = -2
|
|
|
|
-2*$x*$x*$x+3*$x*$x
|
|
|
|
circ is an interpolation that results in a proper quarter circle when
|
|
used on two interpolation base lines of the same length that have a
|
|
common vertex
|
|
|
|
\
|
|
\
|
|
--------U----+
|
|
-----....\ |
|
|
"X |
|
|
\\ |
|
|
\\|
|
|
|V
|
|
||\
|
|
|| \
|
|
|
|
X = (cos phi, sin phi) = (x,y)
|
|
|
|
l = (x + µ y, y - µ y)
|
|
|
|
U = (x + µ1 y, y - µ1 x = 1)
|
|
V = (x + µ2 y = 1, y - µ2 x)
|
|
|
|
µ1 = (y-1)/x
|
|
µ2 = (1-x)/y
|
|
|
|
U = (x + y(y-1)/x, 1)
|
|
V = (1, y - x(1-x)/y)
|
|
|
|
dxU = y(y-1)/x
|
|
dyU = 1-y
|
|
dxV = 1-x
|
|
dyV = x(1-x)/y
|
|
|
|
l1 = sqrt (dxU*dxU + dyU*dyU)
|
|
l2 = sqrt (dxV*dxV + dyV*dyV)
|
|
|