Class Trend
Fits a line through recent readings, so a slow drift shows before it matters.
public sealed class Trend : IDisposable
- Inheritance
-
Trend
- Implements
- Inherited Members
Constructors
Trend(int)
Creates an empty trend estimator.
public Trend(int capacity = 32)
Parameters
capacityintHow many readings to fit the line through, from 2 to 32, since a line needs two; 32 unless told fewer.
Exceptions
- ArgumentOutOfRangeException
capacityis not from 2 to 32.
Properties
Capacity
How many readings the estimator keeps.
public int Capacity { get; }
Property Value
Slope
The fitted slope in units per reading, or null without two readings. A
positive slope is a rising signal.
public float? Slope { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Push(float)
Adds a reading.
public void Push(float reading)
Parameters
readingfloatThe reading to add. One that is not a finite number is not kept.