# Linear - method of the Pm object

###### Description:
Obtains the value of the linear function that is defined by the [x1,fx1] and [x2, fx2] points.
###### Syntax:
Double Linear(Double Val, Double x1, Double x2, Double fx1, Double fx2, Long Attr)
###### Parameters:
Val (Double) Argument for which the functional value is determined (Double) First point argument of the linear function (Double) Second point argument of the linear function (Double) Functional value of the first point argument (Double) Functional value of the second point argument (Long) The calculation attribute 0 - Val is the value of the argument, the method returns the functional value. If Val < x1, then returns fx1 If Val > x2, then returns fx2 Otherwise returns the functional value of the linear function 1 - Val is the functional value, the method returns the argument. If the Val is outside the (fx1, fx2) interval, then the return value is x1 or x2. 2 - Val if the value of the argumentu, the method returns the functional value. The function is linear in the whole definition scope. 3 - Val is the functional value, the method returns the argument. The function is linear in the whole definition scope.
###### Note:
This method is functional also in Macro expression \$.expr and in the onDraw event of the PmgCanvas object.
This method is also functional in Web panels.
``` var fx = Pm.Linear(0.5, 0, 1, 4, 5, 2);   // The 4.5 value will be in the fx variable```