Handbook
Glossary
<bezier-curve> ( control-points -- polynomials )
Vocabulary
math
.
splines
Inputs
control-points
sequence of control points same dimension
Outputs
polynomials
sequence of polynomials for each dimension
Word description
Creates bezier curve polynomials for the given control points.
Definition
USING:
kernel
math
math.polynomials
math.splines.private
sequences
;
IN:
math.splines
::
<bezier-curve>
( control-points -- polynomials )
control-points
[
length
1
-
]
[
first
length
[
{
0
}
]
replicate
]
bi
:>
( n acc ) control-points
[|
pt i |
n i
bernstein-polynomial-ith
:>
poly pt
[|
v j | j acc
[
v poly
n*p
p+
]
change-nth
]
each-index
]
each-index
acc
;