/** * returns true if this boxes maximum point x value <= referenceX */ public boolean isBoxAtOrLeftOf(double referenceX) { return (maxPoint.getX() <= referenceX); }
public double getMaxAlpha() { Point2d lastPoint = this.segmentPoints[segmentPoints.length]; return lastPoint.getX(); }
public Point2d[] findMinMaxPoints(double x) { for (Point2d[] minMaxPoint : minMaxPoints) { if (Math.abs(x - minMaxPoint[0].getX()) < 1e-7) return minMaxPoint; } return null; }
public void save(PrintWriter printWriter) { for (int i = 0; i < points.size(); i++) { Point2d coordinate = points.get(i); printWriter.println(coordinate.getX() + " " + coordinate.getY()); } }
public void drawCircleWithRotatedCross(PlotterReferenceFrame frame, Point2d center, Vector2d radii) { double distanceX = 0.707 * radii.getX(); double distanceY = 0.707 * radii.getY(); drawOval(frame, center, radii); drawLineSegment(frame, center.getX() - distanceX, center.getY() - distanceY, center.getX() + distanceX, center.getY() + distanceY); drawLineSegment(frame, center.getX() - distanceX, center.getY() + distanceY, center.getX() + distanceX, center.getY() - distanceY); }
public FootSwingInclusionFunction(Point2d start, Point2d end, double pathWidth) { pathOrigin = new Point2d(start.getX(), start.getY()); trajectoryDirection = new Vector2d(end.getX() - start.getX(), end.getY() - start.getY()); pathLength = trajectoryDirection.length(); trajectoryDirection.normalize(); this.pathWidth = pathWidth; }
public void drawDiamond(PlotterReferenceFrame frame, Point2d center, Vector2d radii) { drawLineSegment(frame, center.getX() - radii.getX(), center.getY(), center.getX(), center.getY() + radii.getY()); drawLineSegment(frame, center.getX() - radii.getX(), center.getY(), center.getX(), center.getY() - radii.getY()); drawLineSegment(frame, center.getX(), center.getY() + radii.getY(), center.getX() + radii.getX(), center.getY()); drawLineSegment(frame, center.getX(), center.getY() - radii.getY(), center.getX() + radii.getX(), center.getY()); }
public void drawCircleWithCross(PlotterReferenceFrame frame, Point2d center, Vector2d radii) { drawOval(frame, center, radii); drawLineSegment(frame, center.getX() - radii.getX(), center.getY(), center.getX() + radii.getX(), center.getY()); drawLineSegment(frame, center.getX(), center.getY() - radii.getY(), center.getX(), center.getY() + radii.getY()); }
public void update(Point2d point2dUnfiltered) { x.update(point2dUnfiltered.getX()); y.update(point2dUnfiltered.getY()); }
public Plane3d calculatePlane(HeightMapWithPoints heightMap, Point2d center, double xExtent, double yExtent, InclusionFunction<Point3d> kernelMask) throws InsufficientDataException { if ((xExtent == 0) || (yExtent == 0)) throw new RuntimeException("empty search region."); pointList = heightMap.getAllPointsWithinArea(center.getX(), center.getY(), xExtent, yExtent, kernelMask); Plane3d ret = new Plane3d(); planeFitter.fitPlaneToPoints(center, pointList, ret); return ret; }
public boolean intersectionWith(Line2d secondLine, Point3d intersectionToPack) { boolean success = GeometryTools.getIntersectionBetweenTwoLines(point, normalizedVector, secondLine.point, secondLine.normalizedVector, tempPoint2d); if (success) intersectionToPack.set(tempPoint2d.getX(), tempPoint2d.getY(), intersectionToPack.getZ()); return success; }
public boolean isPointOnLine(Point2d point) { double epsilon = 1e-8; if (Math.abs(normalizedVector.getX()) < 10E-10) return MathTools.epsilonEquals(point.x, this.point.getX(), epsilon); // y = A*x + b with point = (x,y) double A = normalizedVector.getY()/normalizedVector.getX(); double b = this.point.getY()-A*this.point.getX(); double value = point.getY() - A*point.getX() - b; return epsilon > Math.abs(value); }
@Override public void drawLegend(Plotter2DAdapter graphics, Point2d origin) { graphics.setColor(color); graphics.setFont(font); tempPoint.set(origin.getX() - 30.0, origin.getY() + 6.0); graphics.drawString(graphics.getScreenFrame(), text, tempPoint); }
public static MeshDataHolder Polygon(ConvexPolygon2d convexPolygon) { Point3f[] points = new Point3f[convexPolygon.getNumberOfVertices()]; for (int i = 0; i < convexPolygon.getNumberOfVertices(); i++) { Point2d vertex = convexPolygon.getVertex(i); points[i] = new Point3f((float) vertex.getX(), (float) vertex.getY(), 0.0f); } return Polygon(points); }
public void getPointGivenParameter(double t, Point2d pointToPack) { pointToPack.set(point); pointToPack.setX(pointToPack.getX() + t * normalizedVector.getX()); pointToPack.setY(pointToPack.getY() + t * normalizedVector.getY()); }
private void drawPolygon(FrameConvexPolygon2d frameConvexPolygon2d, Graphics graphics) { Polygon polygon = new Polygon(); for (int i = 0; i < frameConvexPolygon2d.getNumberOfVertices(); i++) { Point2d vertex = frameConvexPolygon2d.getVertex(i); int xInt = doubleToInt(vertex.getX(), xCenter, scale, getWidth()); int yInt = doubleToInt(vertex.getY(), yCenter, -scale, getHeight()); polygon.addPoint(xInt, yInt); } graphics.drawPolygon(polygon); }