math: Add linear function handling class

A class that capsules a linear function. Can be
used in any algorithm that uses a linear function
because this simplifies calculations much and
makes it also more readable.