00001 package commandline.Distributions;
00002
00003 import junit.framework.Assert;
00004
00005 import commandline.ImageStuff.GeometricObjects.GenericEdge;
00006
00007 public class NormalIndicesDistribution_2A_paper extends
00008 NormalIndicesDistribution {
00009 VerticalDistribution verticalDistribution_discr;
00010 public NormalIndicesDistribution_2A_paper(VerticalDistribution verticalDistribution_discr) {
00011 super();
00012 this.verticalDistribution_discr=verticalDistribution_discr;
00013
00014 }
00015
00016 @Override
00017 protected double evaluatePDF(double x, float n_0,
00018 float n_1, GenericEdge edge) {
00019 float H=edge.getHoogte();
00020 float length=edge.getEuclidischeLengte();
00021 float lambda_streep= verticalDistribution_discr.getSchatter();
00022 double i=x-length/2;
00023 if(i>=0)return getEersteTerm_right(i,H,length,lambda_streep,n_0,n_1);
00024 else{
00025 return getEersteTerm_left(i,H,length,lambda_streep,n_0,n_1);
00026 }
00027 }
00028
00029 private double getEersteTerm_right(double x, double H, double length,
00030 float lambda_streep, float n_0, float n_1){
00031 Assert.assertTrue(x>0);
00032 double h_0=super.scaleLambaEstimator(lambda_streep,n_0);
00033 double i=x;
00034 double l=length;
00035 return (float)(float) h_0 * (float) (l - 2 * i) * (float)Math.exp(-(float) (h_0 / H * Math.abs(-2 * i * l + H * H)) / 0.2e1f) / (float) l / 0.4e1f;
00036 }
00037
00038 private double getEersteTerm_left(double x, double H, double length,
00039 float lambda_streep, float n_0, float n_1){
00040 Assert.assertTrue(x<0);
00041 return getEersteTerm_right(Math.abs(x),H,length,lambda_streep,n_1,n_0);
00042 }
00043
00044 }