Fast Bezier Curves
Version 1.0.0 (1.86 KB) by
Moreno, M.
Evaluates a Bezier curve given its control points and knot vector or resolution.
% Generate control points
x = rand(5, 2);
% Evaluate Bezier uniformly
[y, b] = bez(x, 100); % Export binomial coefficients
% Evaluate Bezier at knots
z = bez(x, rand(5, 1), b); % Recycle binomial calculation
% Plot results
figure
hold on
plot(y(:, 1), y(:, 2), 'LineWidth', 1.5)
plot(z(:, 1), z(:, 2), 'o', 'LineWidth', 1.2, 'MarkerFaceColor', 'w')
plot(x(:, 1), x(:, 2), '.-', 'LineWidth', 1, 'MarkerSize', 12)
fprintf('Binomial coefficient: [%d %d %d %d %d]\n', b.')
Cite As
Moreno, M. (2024). Fast Bezier Curves (https://www.mathworks.com/matlabcentral/fileexchange/175205-fast-bezier-curves), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2024b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |