The lab consisted of 6 tasks of which the the results of the first three tasks will be represented here. Most of the tasks consisted of implementing parts of a library.
Task 1
In this task we had to implement two programs.
The first bspline, was suposed to generate points that lie on the inputed bspline ( to draw it ).
The second npInterpol had the job of creating a spline based on multiple two dimensional points.
First running npInterpol and then bspline and drawing the output gives the following result.
Input
x | 4.5 | 14 | 14.6 | 23 | 28 | 20.6 | 10 | 4.5 | 3.5 |
---|---|---|---|---|---|---|---|---|---|
y | 2 | 7 | 7.5 | 1.5 | 8.5 | 13 | 14 | 11 | 15.9 |
npInterpol output
bspline output
Task 2
Here the task was to create a program pInterpol for periodic splines. In this case it is used to appoximate a circle.
Input
pInterpol output
bspline output
Task 3
This task consisted of three programs.
- insertKnots inserts a knot in a spline without altering its shape
- tangent creates a file containing a specified amount of tangents of the spline curve
- makeParallel creates a spline parallel to the original one (our implementation has an error and therefore it’s output has is only partially parallel)
Input spline
insertKnots output
tangent output
makeParallel output
Tasks 4-6 you can find here.