Go Back

MARS 1-3

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

x4.51414.6232820.6104.53.5
y277.51.58.513141115.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.