Addition of Bezier curves #289
Labels
Difficulty: Advanced
Hackathon projects with beginner difficulty
Difficulty: Intermediate
Hackathon projects with intermediate difficulty
FsLab Hackathon 2023
Implementation projects for the 2023 FsLab Hackathon
Description
Bezier curves can be found in sketching software, optimization algorithms and game/movie animations. A curve is drawn between two points that is controlled by m ={1,2,3 .. } control points. If m=1 the resulting curve is quadratic, m=2 results in cubic curves etc.. Nested LERPs are used to identify the desired y-value from an given x value.
Quadratic:
Cubic:
Fourth-order curve:
De Casteljau's algorithm allows the efficient calculation of these curves.
Pointers
xValues.Length = 4
, the first and last point mark the start and end of the curve, while the internal two points serve as control points, leading the resulting curve to be cubic (n-1).bezier
) or t (bezierFromPercentage
).FSharp.Stats/src/FSharp.Stats/Interpolation.fs
Line 2304 in 8fb5d6d
References
Hints (click to expand if you need additional pointers)
To be able to contribute to this library you'll need
to build the binaries yourself follow the instructions
while working on the FSharp.Stats documentation (any file within https://github.com/fslaborg/FSharp.Stats/tree/developer/docs) you can navigate to the project folder with a prompt of your choice and use the command
./build watchdocs
unit tests can be executed via
./build runtests
3D example
The text was updated successfully, but these errors were encountered: