-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDataPoint.cs
More file actions
41 lines (36 loc) · 880 Bytes
/
DataPoint.cs
File metadata and controls
41 lines (36 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace yield
{
public class DataPoint
{
public readonly double X;
public readonly double OriginalY;
public double ExpSmoothedY { get; private set; }
public double AvgSmoothedY { get; private set; }
public double MaxY { get; private set; }
public DataPoint(double x, double y)
{
X = x;
OriginalY = y;
}
public DataPoint(DataPoint point)
{
X = point.X;
OriginalY = point.OriginalY;
ExpSmoothedY = point.ExpSmoothedY;
AvgSmoothedY = point.AvgSmoothedY;
MaxY = point.MaxY;
}
public DataPoint WithExpSmoothedY(double expSmoothedY)
{
return new DataPoint(this) { ExpSmoothedY = expSmoothedY };
}
public DataPoint WithAvgSmoothedY(double avgSmoothedY)
{
return new DataPoint(this) { AvgSmoothedY = avgSmoothedY };
}
public DataPoint WithMaxY(double maxY)
{
return new DataPoint(this) { MaxY = maxY };
}
}
}