private boolean detIsPositive(double x0, double y0, double x1, double y1, double x2, double y2) { double det = (x1*y2 - y1*x2 -x0*y2 + y0*x2 + x0*y1 - y0*x1); if (det == 0) log.warn("determinate = 0 on lat/lon=" + latCoord.getFullName() + ", " + latCoord.getFullName()); // LOOK needed? return det > 0; }
private boolean detIsPositive(double x0, double y0, double x1, double y1, double x2, double y2) { double det = (x1*y2 - y1*x2 -x0*y2 + y0*x2 + x0*y1 - y0*x1); if (det == 0) log.warn("determinate = 0 on lat/lon=" + latCoord.getFullName() + ", " + latCoord.getFullName()); // LOOK needed? return det > 0; }
private boolean detIsPositive(double x0, double y0, double x1, double y1, double x2, double y2) { double det = (x1*y2 - y1*x2 -x0*y2 + y0*x2 + x0*y1 - y0*x1); if (det == 0) log.warn("determinate = 0 on lat/lon=" + latCoord.getFullName() + ", " + latCoord.getFullName()); // LOOK needed? return det > 0; }
private boolean detIsPositive(double x0, double y0, double x1, double y1, double x2, double y2) { double det = (x1*y2 - y1*x2 -x0*y2 + y0*x2 + x0*y1 - y0*x1); if (det == 0) log.warn("determinate = 0 on lat/lon=" + latCoord.getFullName() + ", " + latCoord.getFullName()); // LOOK needed? return det > 0; }
public int findTimeIndexFromCalendarDate(int run_idx, CalendarDate want) throws IOException, InvalidRangeException { CoordinateAxisTimeHelper helper = getCoordinateAxisTimeHelper(); double wantOffset = helper.offsetFromRefDate(want); if (isInterval()) { ArrayDouble.D3 bounds = getCoordBoundsArray(); if (bounds == null) throw new IllegalStateException("getCoordBoundsArray returned null for coordinate "+getFullName()); ArrayDouble.D2 boundsForRun = (ArrayDouble.D2) bounds.slice(0,run_idx ); int idx = findSingleHit(boundsForRun, wantOffset); if (idx >= 0) return idx; if (idx == -1) return -1; // multiple hits = choose closest to the midpoint return findClosest(boundsForRun, wantOffset); } else { ArrayDouble.D2 values = getCoordValuesArray(); ArrayDouble.D1 valuesForRun = (ArrayDouble.D1) values.slice(0,run_idx ); for (int i=0; i<valuesForRun.getSize(); i++) { if (Misc.nearlyEquals(valuesForRun.get(i), wantOffset)) return i; } return -1; } }