Promotic

Linear - method of the Pm object

Description:
Obtains the functional value (or the argument) 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
x1(Double) First point argument of the linear function
x2(Double) Second point argument of the linear function
fx1(Double) Functional value of the first point argument
fx2(Double) Functional value of the second point argument
Attr(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.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var fx = Pm.Linear(0.5, 0, 1, 4, 5, 2);   // The 4.5 value will be in the fx variable
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- Linear
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.