File: scale_linear

package info (click to toggle)
qgis 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 374,696 kB
  • ctags: 66,263
  • sloc: cpp: 396,139; ansic: 241,070; python: 130,609; xml: 14,884; perl: 1,290; sh: 1,287; sql: 500; yacc: 268; lex: 242; makefile: 168
file content (19 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<h3>scale_linear() function</h3>
Transforms a given value from an input domain to an output range using linear interpolation. 

<p><h4>Syntax</h4>
     scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>

<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i>  val</i> &rarr; is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>
<i>  domain_min, domain_max</i> &rarr; specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>
<i>  range_min, range_max</i> &rarr; specify the output range, the smallest and largest values which should be output by the function.<br>

<h4>Example</h4>
<!-- Show example of function.-->
     scale_linear(5,0,10,0,100) &rarr; 50<br>
     scale_linear(0.2,0,1,0,360) &rarr; 72 <i>(eg, scaling a value between 0 and 1 to an angle between 0 and 360)</i><br>
     scale_linear(1500,1000,10000,9,20) &rarr; 10.22 <i>(eg, scaling a population which varies between 1000 and 10000 to a font size between 9 and 20)</i><br>