示例#1
0
    public static double GetSquare(OrganismInfo organismInfo)
    {
        double square = 0;
        float  value1 = 0;
        float  value2 = 0;
        int    i      = 0;

        for (i = 0; i < organismInfo.Points().Count - 1; i++)
        {
            value1 += organismInfo.Points()[i].X * organismInfo.Points()[i + 1].Y;
            value2 += organismInfo.Points()[i].Y * organismInfo.Points()[i + 1].X;
        }
        value1 += organismInfo.Points()[i].X * organismInfo.Points()[0].Y;
        value2 += organismInfo.Points()[i].Y * organismInfo.Points()[0].X;
        square  = (value1 - value2) / 2;
        square  = Math.Abs(square);
        return(square);
    }
示例#2
0
 public Organism(OrganismInfo organismInfo)
 {
     _organismInfo = new OrganismInfo(organismInfo.Points());
     InitializeViability();
 }
示例#3
0
 private void Create()
 {
     _organismInfo = new OrganismInfo();
 }