本文整理汇总了C#中LineSeries.Interpolate方法的典型用法代码示例。如果您正苦于以下问题:C# LineSeries.Interpolate方法的具体用法?C# LineSeries.Interpolate怎么用?C# LineSeries.Interpolate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineSeries
的用法示例。
在下文中一共展示了LineSeries.Interpolate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InterpolatePerformance2
public void InterpolatePerformance2(LineSeries.SearchType search_type)
{
var valueGroups = Enumerable.Range(0, 1000001).Select(x => x * 1.0).ToLookup(x => ((int)x) % 2);
var interPoints = valueGroups[1].ToList();
var valuePoints = valueGroups[0].Select(x => new Point(x, x)).ToList();
var series = new LineSeries(valuePoints);
var result = series.Interpolate(interPoints, search_type).ToList();
}
示例2: InterpolatePerformance1
public void InterpolatePerformance1(LineSeries.SearchType search_type)
{
var size = 1000000;
var valuePoints = new List<Point>() {
new Point(0, 0),
new Point(size, size),
};
var interPoints = Enumerable.Range(0, size).Select(x => x * 1.0).ToList();
var series = new LineSeries(valuePoints);
var result = series.Interpolate(interPoints, search_type).ToList();
var expected = Enumerable.Range(0, size).Select(x => new Point(x, x)).ToList();
CollectionAssert.AreEqual(expected, result);
}
示例3: InterpolatePerformance3
public void InterpolatePerformance3(LineSeries.SearchType search_type)
{
var randNumbers = new Random(0);
var interPoints = new List<double>();
var valuePoints = new List<Point>();
for (int i = 0; i < 100000; i++)
{
interPoints.Add(interPoints.LastOrDefault() + 100 * randNumbers.NextDouble());
}
for (int i = 0; i < 10000000; i++)
{
valuePoints.Add(new Point(valuePoints.LastOrDefault().X + randNumbers.NextDouble(), randNumbers.NextDouble()));
}
var series = new LineSeries(valuePoints);
var result = series.Interpolate(interPoints, search_type).ToList();
}
示例4: InterpolateTest
public void InterpolateTest()
{
var points = new List<Point>() { new Point(0, 0), new Point(10, 10), new Point(30, -10), new Point(50, 10) };
var lineSeries = new LineSeries(points);
var result = lineSeries.Interpolate(new Double[] { 0, 5, 10, 15, 20, 25, 35, 40, 45 });
var expectedResult = new List<Point>()
{
new Point(0,0),
new Point(5,5),
new Point(10,10),
new Point(15,5),
new Point(20, 0),
new Point(25, -5),
new Point(35,-5),
new Point(40,0),
new Point(45,5)
};
CollectionAssert.AreEqual(expectedResult, result);
}