/** * Constructs a circle with the specified properties */ public Circle (XY p, float radius) { this(p.x(), p.y(), radius); }
/** * Configures the start, control, and end points for this curve, using the values at the * specified offset in the {@code points} array. */ public void setCurve (XY[] points, int offset) { setCurve(points[offset + 0].x(), points[offset + 0].y(), points[offset + 1].x(), points[offset + 1].y(), points[offset + 2].x(), points[offset + 2].y()); }
/** * Sets the starting angle and angular extent of this arc using two sets of coordinates. The * first set of coordinates is used to determine the angle of the starting point relative to * the arc's center. The second set of coordinates is used to determine the angle of the end * point relative to the arc's center. The arc will always be non-empty and extend * counterclockwise from the first point around to the second point. */ public void setAngles (XY p1, XY p2) { setAngles(p1.x(), p1.y(), p2.x(), p2.y()); }
/** * Constructs a rectangle with the supplied upper-left corner and dimensions (0,0). */ public Rectangle (XY p) { setBounds(p.x(), p.y(), 0, 0); }
/** * Expands the bounds of this rectangle to contain the supplied point. */ public void add (XY p) { add(p.x(), p.y()); }
/** * Returns true if an {@link XY} touches a {@link Layer}. Note: if the supplied layer has no * size, this will always return false. */ public static boolean hitTest(Layer layer, XY pos) { return hitTest(layer, pos.x(), pos.y()); }
/** * Sets the upper-left corner of this rectangle to the supplied point. */ public void setLocation (XY p) { setLocation(p.x(), p.y()); }
/** Sets the coordinates of this point to be equal to those of the supplied point. * @return a reference to this this, for chaining. */ public Point set (XY p) { return set(p.x(), p.y()); }
/** * Constructs a point with coordinates equal to the supplied point. */ public Point (XY p) { set(p.x(), p.y()); }
/** * Constructs a rectangle with upper-left corner at the supplied point and with the supplied * dimensions. */ public Rectangle (XY p, IDimension d) { setBounds(p.x(), p.y(), d.width(), d.height()); }
/** * Sets the location, size, angular extents, and closure type of this arc to the specified * values. */ public void setArc (XY point, IDimension size, float start, float extent, int type) { setArc(point.x(), point.y(), size.width(), size.height(), start, extent, type); }
/** * Sets the location and size of the framing rectangle of this shape to the supplied values. */ public void setFrame (XY loc, IDimension size) { setFrame(loc.x(), loc.y(), size.width(), size.height()); }
@Override // from ICircle public boolean contains (XY p) { float r = radius(); return Points.distanceSq(x(), y(), p.x(), p.y()) < r * r; }