public void Test() { var ellipse = new EllipticArea(0.3, 0.5, 0.5); ellipse.Angle = Math.PI / 4; ellipse.A = 0.5; ellipse.B = 0.1; var result = MathHelper.GetEllipticDistance(ellipse, 0.5, 0.7); }
public double ComputeDistanceRatioFromElipse(double quality, double criticality, EllipticArea area) { var distance = MathHelper.GetEllipticDistance(area, quality, criticality); if (distance > 1) { return(0); } else { return(1 - distance); } }
public static double GetEllipticDistance(EllipticArea ellipse, double quality, double risk) { return(GetEllipticDistance(ellipse.U, ellipse.V, quality, risk, ellipse.A * 2, ellipse.B * 2, ellipse.Angle)); }
public double ComputeDistanceRatioFromCircleArea(double quality, double criticality, EllipticArea area) { var distance = MathHelper.Distance(quality, criticality, area.U, area.V); if (distance > area.R) { return(0); } else { return(1 - distance / area.R); } }