using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
|
namespace Yw.Coordinate
|
{
|
public interface IAxisCalcer
|
{
|
double Calc(double v);
|
double RevCalc(double v);
|
}
|
|
public class ConstantAxis : IAxisCalcer
|
{
|
public double Calc(double v)
|
{
|
return v;
|
}
|
public double RevCalc(double v)
|
{
|
return v;
|
}
|
}
|
|
public class Log10Axis : IAxisCalcer
|
{
|
public double Calc(double v)
|
{
|
return Math.Log10(v);
|
}
|
public double RevCalc(double v)
|
{
|
return Math.Pow(10, v);
|
}
|
}
|
|
public class CoefficientAxis : IAxisCalcer
|
{
|
private double Coeff = 1;
|
public CoefficientAxis(double coeff)
|
{
|
Coeff = coeff;
|
}
|
public double Calc(double v)
|
{
|
return v * Coeff;
|
}
|
public double RevCalc(double v)
|
{
|
return v / Coeff;
|
}
|
}
|
}
|