/** * Returns a Point2d copy of the tuple in this FrameTuple. * * @return Point2d */ public final Point2d getPointCopy() { return new Point2d(tuple); }
private Point2d[] fromIndexToLL_UR(final long index) { final double llLon = ((Math.floor(index / (double) numYPosts) * 360.0) / numXPosts) - 180.0; final double llLat = (((index % numYPosts) * 180.0) / numYPosts) - 90.0; final double urLon = llLon + (360.0 / numXPosts); final double urLat = llLat + (180.0 / numYPosts); return new Point2d[] {new Point2d(llLon, llLat), new Point2d(urLon, urLat)}; }
public static Point2d[] intersectionWithLineCopy(Line2d line, ConvexPolygon2d polygon) { Point2d point1 = new Point2d(); Point2d point2 = new Point2d(); int intersections = intersectionWithLine(line, point1, point2, polygon); if (intersections == 2) return new Point2d[] {point1, point2}; if (intersections == 1) return new Point2d[] {point1}; return null; }
public static Point2d[] intersectionWithLineSegmentCopy(LineSegment2d lineSegment, ConvexPolygon2d polygon) { Point2d point1 = new Point2d(); Point2d point2 = new Point2d(); int intersections = intersectionWithLineSegment(lineSegment, point1, point2, polygon); if (intersections == 2) return new Point2d[] {point1, point2}; if (intersections == 1) return new Point2d[] {point1}; return null; }
public static Point2d getClosestVertexCopy(Point2d point, ConvexPolygon2d polygon) { Point2d ret = new Point2d(); if (getClosestVertex(point, polygon, ret)) return ret; return null; }
public Point2d midpoint() { Point2d point2d = new Point2d(); getMidpoint(point2d); return point2d; }
public Point2d pointBetweenEndPointsGivenParameter(double parameter) { Point2d pointToReturn = new Point2d(); pointBetweenEndPointsGivenParameter(parameter, pointToReturn); return pointToReturn; }
private void setOrCreate(double x, double y, int i) { while (i >= clockwiseOrderedListOfPoints.size()) clockwiseOrderedListOfPoints.add(new Point2d()); clockwiseOrderedListOfPoints.get(i).set(x, y); }
public Point2d getPointGivenParameter(double t) { Point2d pointToReturn = new Point2d(); getPointGivenParameter(t, pointToReturn); return pointToReturn; }
public static GrahamScanConvexHullCalculator2d createFromPointList(double[][] pointList) { int numberOfPoints = pointList.length; ArrayList<Point2d> points = new ArrayList<Point2d>(numberOfPoints); for (int i = 0; i < numberOfPoints; i++) { points.add(new Point2d(pointList[i])); } return new GrahamScanConvexHullCalculator2d(points); }
public static Point2d[] getLineOfSightVerticesCopy(Point2d observer, ConvexPolygon2d polygon) { int[] indices = getLineOfSightVertexIndicesCopy(observer, polygon); if (indices == null) return null; Point2d point1 = new Point2d(polygon.getVertex(indices[0])); Point2d point2 = new Point2d(polygon.getVertex(indices[1])); if (indices[0] == indices[1]) return new Point2d[] {point1}; return new Point2d[] {point1, point2}; }
public static Point2d readPoint(final String tagName, final Element parentEl) { final Element ptEl = parentEl.getChild(tagName); if (ptEl == null) { return null; } else { final double lat = getDoubleVal(ptEl, JDOMUtils.tagLat); final double lon = getDoubleVal(ptEl, JDOMUtils.tagLon); return new Point2d(lon, lat); } }
public static Point2d readPoint2d(final String tagName, final Element parentEl) { final Element ptEl = parentEl.getChild(tagName); if (ptEl == null) { return null; } else { final double x = getDoubleVal(ptEl, JDOMUtils.tagX); final double y = getDoubleVal(ptEl, JDOMUtils.tagY); return new Point2d(x, y); } }
public static Point2d readPoint(final Element ptEl) { if (ptEl == null) { return null; } else { final double lat = getDoubleVal(ptEl, JDOMUtils.tagLat); final double lon = getDoubleVal(ptEl, JDOMUtils.tagLon); return new Point2d(lon, lat); } }
public static Point2d readPoint2d(final Element ptEl) { if (ptEl == null) { return null; } else { final double x = getDoubleVal(ptEl, JDOMUtils.tagX); final double y = getDoubleVal(ptEl, JDOMUtils.tagY); return new Point2d(x, y); } }
public Point2d getMaxXMaxYPointCopy() { checkIfUpToDate(); return new Point2d(getVertex(maxXmaxY_index)); }
private Point2d interpolate(Point2d startPoint, Point2d endPoint, double x) { double startX = startPoint.getX(); double endX = endPoint.getX(); double startY = startPoint.getY(); double endY = endPoint.getY(); double percentX = (x - startX) / (endX - startX); double y = startY + percentX * (endY - startY); return new Point2d(x, y); }