X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=doc%2Frrdgraph_rpn.pod;h=dfc9a0bda903e77d6538fa7cffe38eb079a4376e;hb=97939155f7c748cd3729dd5f4e1b6707a82a817c;hp=ff50865c77459c839b115154c58338695d180321;hpb=26f7c5c1ba83c8ab82cd271b143061f7fb13394c;p=rrdtool.git diff --git a/doc/rrdgraph_rpn.pod b/doc/rrdgraph_rpn.pod index ff50865..dfc9a0b 100644 --- a/doc/rrdgraph_rpn.pod +++ b/doc/rrdgraph_rpn.pod @@ -1,4 +1,4 @@ -=head1 NAME +=head1 NAME rrdgraph_rpn - About RPN Math in rrdtool graph @@ -15,11 +15,12 @@ takes as many elements from the stack as needed. Pushing is done implicitly, so whenever you specify a number or a variable, it gets pushed onto the stack automatically. -At the end of the calculation there should be one and only one -value left on the stack. This is the outcome of the function and -this is what is put into the I. For B instructions, -the stack is processed for each data point on the graph. B -instructions work on an entire data set in one run. +At the end of the calculation there should be one and only one value left on +the stack. This is the outcome of the function and this is what is put into +the I. For B instructions, the stack is processed for each +data point on the graph. B instructions work on an entire data set in +one run. Note, that currently B instructions only support a limited +list of functions. Example: C @@ -69,7 +70,7 @@ Z<> =item Comparing values -B +B Pops two elements from the stack and returns the smaller or larger, respectively. Note that I is larger than anything else. @@ -107,11 +108,24 @@ B Arctangent (output in radians). +B + +Arctangent of y,x components (output in radians). +This pops one element from the stack, the x (cosine) component, and then +a second, which is the y (sine) component. +It then pushes the arctangent of their ratio, resolving the ambiguity between +quadrants. + +Example: C will convert C +components into an angle in degrees. + B Round down or up to the nearest integer. -Z<> +B + +Convert angle in degrees to radians, or radians to degrees. =item Set Operations @@ -140,7 +154,7 @@ average is essentially computed as shown here: delay t0 <---------------> delay t1 - <---------------> + <---------------> delay t2 <---------------> @@ -177,13 +191,11 @@ function cannot be used in B instructions. B -Pushes the number 1 if this is the first value of the data set, the -number 2 if it is the second, and so on. This special value allows -you to make calculations based on the position of the value within +Pushes the number 1 if this is the first value of the data set, the +number 2 if it is the second, and so on. This special value allows +you to make calculations based on the position of the value within the data set. This function cannot be used in B instructions. -Z<> - =item Time Time inside RRDtool is measured in seconds since the epoch. The @@ -217,7 +229,7 @@ Z<> =head1 VARIABLES -These operators work only on B statements. +These operators work only on B statements. Note that currently ONLY these work for B. =over 4 @@ -259,6 +271,18 @@ finite numbers and are always more than the I numbers. Example: C +=item LSLSLOPE, LSLINT, LSLCORREL + +Return the parameters for a Beast Bquares Bine I<(y = mx +b)> +which approximate the provided dataset. LSLSLOPE is the slope I<(m)> of +the line related to the COUNT position of the data. LSLINT is the +y-intercept I<(b)>, which happens also to be the first data point on the +graph. LSLCORREL is the Correlation Coefficient (also know as Pearson's +Product Moment Correlation Coefficient). It will range from 0 to +/-1 +and represents the quality of fit for the approximation. + +Example: C + =back =head1 SEE ALSO