Initial Commit

This commit is contained in:
2024-02-23 00:46:06 -05:00
commit 2bbedc0178
470 changed files with 46035 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Microsoft.Research.DynamicDataDisplay.Charts.Axes.Numeric
{
internal sealed class NumericConversion
{
private readonly double min;
private readonly double length;
private readonly double minValue;
private readonly double valueLength;
public NumericConversion(double min, double minValue, double max, double maxValue)
{
this.min = min;
this.length = max - min;
this.minValue = minValue;
this.valueLength = maxValue - minValue;
}
public double FromDouble(double value)
{
double ratio = (value - min) / length;
return minValue + ratio * valueLength;
}
public double ToDouble(double value)
{
double ratio = (value - minValue) / valueLength;
return min + length * ratio;
}
}
}