Splines
Splines
BSplineKit.Splines.Spline
— TypeSpline{T}
Represents a spline function.
Spline(B::BSplineBasis, coefs::AbstractVector)
Construct a spline from a B-spline basis and a vector of B-spline coefficients.
Examples
julia> B = BSplineBasis(BSplineOrder(4), -1:0.2:1);
julia> coefs = rand(length(B));
julia> S = Spline(B, coefs)
13-element Spline{Float64}:
order: 4
knots: [-1.0, -1.0, -1.0, -1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.0, 1.0, 1.0]
coefficients: [0.18588655648969699, 0.9029166384444702, 0.9260613807703459, 0.8547964724816131, 0.39474318453198, 0.7014911606231877, 0.7532136707230797, 0.9360833341053749, 0.23429394964461725, 0.8755953969471848, 0.8421116493609568, 0.6943510993657007, 0.3825519047441852]
Spline(undef, B::BSplineBasis, [T=Float64])
Construct a spline with uninitialised vector of coefficients.
(S::Spline)(x)
Evaluate spline at coordinate x
.
BSplineKit.Splines.coefficients
— Functioncoefficients(S::Spline)
Get B-spline coefficients of the spline.
Base.eltype
— Methodeltype(S::Spline)
Returns type of element returned when evaluating the Spline
.
Base.length
— Methodlength(S::Spline)
Returns the number of coefficients in the spline.
Note that this is equal to the number of basis functions, length(basis(S))
.
BSplineKit.BSplines.basis
— Methodbasis(S::Spline) -> BSplineBasis
Returns the associated B-spline basis.
Derivatives and integrals
Base.diff
— Functiondiff(S::Spline, [deriv::Derivative = Derivative(1)]) -> Spline
Return N
-th derivative of spline S
as a new spline.
BSplineKit.Splines.integral
— Functionintegral(S::Spline)
Returns an antiderivative of the given spline as a new spline.
The algorithm is described in de Boor 2001, p. 127.