Skip to content
Snippets Groups Projects
Commit 2d521c53 authored by Антон Кудряшов's avatar Антон Кудряшов
Browse files

fixed specific coordinates method

parent 8e43b46f
Branches
No related tags found
No related merge requests found
......@@ -284,13 +284,15 @@ namespace WindStressPRM
Coordinate firstCoordinate = Input.ClimateCells.Origin;
Index lastIndex = new Index( Input.ClimateCells.RowsCount() - 1, Input.ClimateCells.ColumnCount() - 1);
Coordinate lastCoordinate = Input.ClimateCells.CellToProjection(lastIndex);
for (double x = firstCoordinate.X; x <= lastCoordinate.X;
x += Math.Sign(lastCoordinate.X - firstCoordinate.X)*Input.Distance35kVCheck)
double x = firstCoordinate.X;
double y = firstCoordinate.Y;
while (Math.Sign(lastCoordinate.X - firstCoordinate.X) * (lastCoordinate.X - x) >= 0)
{
for (double y = firstCoordinate.Y; y <= lastCoordinate.Y;
y += Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * Input.Distance35kVCheck)
while (Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * (lastCoordinate.Y - y) >= 0)
{
Coordinate current = new Coordinate(x, y);
y += Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * Input.Distance35kVCheck;
double wind = interpol<ClimateCell>(current, Input.ClimateCells, delegate(ClimateCell cell) { return cell.Wind10; });
double u = interpol<PrognosticCell>(current, Input.PrognosticCells, delegate(PrognosticCell cell) { return cell.VelocityX; });
double v = interpol<PrognosticCell>(current, Input.PrognosticCells, delegate(PrognosticCell cell) { return cell.VelocityY; });
......@@ -306,6 +308,7 @@ namespace WindStressPRM
list.Add(current);
}
}
x += Math.Sign(lastCoordinate.X - firstCoordinate.X) * Input.Distance35kVCheck;
}
return list;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment