Package org.eclipse.gef.geometry.planar

# Class BezierCurve

java.lang.Object
org.eclipse.gef.geometry.planar.BezierCurve

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `ICurve`, `IGeometry`, `IRotatable<BezierCurve>`, `IScalable<BezierCurve>`, `ITranslatable<BezierCurve>`

Direct Known Subclasses:
  `CubicCurve`, `Line`, `QuadraticCurve`

public class BezierCurve extends Object implements ICurve, ITranslatable<BezierCurve>, IScalable<BezierCurve>, IRotatable<BezierCurve>

Instances of the `BezierCurve` class individually represent an arbitrary Bezier curve. This is the base class of the special quadratic and cubic Bezier curve classes (`QuadraticCurve` and `CubicCurve`).

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`BezierCurve(double... controlPoints)`
Constructs a new `BezierCurve` from the given control `Point` coordinates.
`BezierCurve(CubicCurve c)`
Constructs a new `BezierCurve` from the given `CubicCurve`.
`BezierCurve(Point... controlPoints)`
Constructs a new `BezierCurve` from the given control `Point` s.
`BezierCurve(QuadraticCurve c)`
Constructs a new `BezierCurve` from the given `QuadraticCurve`.

## Method Summary

Modifier and Type
Method
Description
`Object`
`clone()`
Overridden with public visibility as recommended within `Cloneable` .
`boolean`
`contains(BezierCurve o)`
Tests if this `BezierCurve` contains the given other `BezierCurve`.
`boolean`
`contains(Point p)`
Returns whether the given `Point` is contained within this `IGeometry`.
`boolean`
`equals(Object other)`
`Point`
`get(double t)`
Computes the `Point` on this `BezierCurve` at parameter value t, which is expected to lie in the parameter `BezierCurve.Interval` `[0;1]`.
`Rectangle`
`getBounds()`
Returns the smallest `Rectangle` fully enclosing this `IGeometry`.
`BezierCurve`
`getClipped(double s, double e)`
Returns a new `BezierCurve` object representing this `BezierCurve` on the `BezierCurve.Interval` `[s;e]`.
`Rectangle`
`getControlBounds()`
Returns a bounding `Rectangle` of the control `Polygon` of this `BezierCurve`.
`BezierCurve`
`getCopy()`
Returns a new identical copy of this `IGeometry`.
`BezierCurve`
`getDerivative()`
Computes the hodograph, the first parametric derivative, of this `BezierCurve`.
`BezierCurve`
`getElevated()`
Computes a `BezierCurve` with a degree of one higher than this `BezierCurve`'s degree but of the same shape.
`Point[]`
`getIntersections(BezierCurve other)`
Returns the `Point`s of intersection of this and the given other `BezierCurve`.
`final Point[]`
`getIntersections(ICurve curve)`
Returns the points of intersection between this `ICurve` and the given `ICurve`.
`PolyBezier`
`getOffset(double distance)`
Returns a `PolyBezier` that represents an approximation of the refined offset of this `BezierCurve` where cusps in the input curve are approximated by arc segments in the offset and local self-intersections in the offset are removed while global self-intersections and other singularities in the offset remain unprocessed.
`BezierCurve`
`getOverlap(BezierCurve other)`
Returns a `BezierCurve` that represents the overlap of this `BezierCurve` and the given other `BezierCurve`.
`final ICurve[]`
`getOverlaps(ICurve c)`
Returns the curve segments at which this `ICurve` and the given `ICurve` overlap.
`Point`
`getP1()`
Returns a `Point` representing the start point of this `ICurve`.
`Point`
`getP2()`
Returns a `Point` representing the end point of this `ICurve` .
`double`
`getParameterAt(Point p)`
Returns the parameter value of this `BezierCurve` for the given `Point`.
`Point`
`getPoint(int i)`
Returns the ith control `Point` of this `BezierCurve`.
`Point[]`
`getPoints()`
Returns the control `Point`s of this `BezierCurve`.
`Point`
`getProjection(Point reference)`
Returns a projection of the given reference `Point` onto this `ICurve`, i.e. a `Point` on this `ICurve` that is closest to the given reference `Point`.
`BezierCurve`
`getRotatedCCW(Angle angle)`
Rotates the calling object by specified `Angle` counter-clock-wise (CCW) around its center `Point`.
`BezierCurve`
`getRotatedCCW(Angle angle, double cx, double cy)`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point` (cx, cy).
`BezierCurve`
`getRotatedCCW(Angle angle, Point center)`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point`.
`BezierCurve`
`getRotatedCW(Angle angle)`
Rotates the calling object by specified `Angle` clock-wise (CW) around its center `Point`.
`BezierCurve`
`getRotatedCW(Angle angle, double cx, double cy)`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point` (cx, cy).
`BezierCurve`
`getRotatedCW(Angle angle, Point center)`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point`.
`BezierCurve`
`getScaled(double factor)`
Scales a copy of the calling object by the given factor relative to its center `Point`.
`BezierCurve`
`getScaled(double fx, double fy)`
Scales a copy of the calling object by the given factors relative to its center `Point`.
`BezierCurve`
`getScaled(double factor, double cx, double cy)`
Scales a copy of the calling object by the given factor relative to the given center `Point` (cx, cy).
`BezierCurve`
`getScaled(double fx, double fy, double cx, double cy)`
Scales a copy of the calling object by the given factors relative to the given center `Point` (cx, cy).
`BezierCurve`
`getScaled(double fx, double fy, Point center)`
Scales a copy of the calling object by the given factors relative to the given center `Point`.
`BezierCurve`
`getScaled(double factor, Point center)`
Scales a copy of the calling object by the given factor relative to the given center `Point`.
`BezierCurve`
`getTransformed(AffineTransform t)`
Default implementation returning a transformed `Path` representation of this `IGeometry`.
`BezierCurve`
`getTranslated(double dx, double dy)`
Translates a copy of this object by the given values in x and y direction.
`BezierCurve`
`getTranslated(Point d)`
Translates a copy of this object by the given `Point`.
`double`
`getX1()`
Returns the start `Point`'s x coordinate.
`double`
`getX2()`
Returns the end `Point`'s x coordinate.
`double`
`getY1()`
Returns the start `Point`'s y coordinate.
`double`
`getY2()`
Returns the end `Point`'s y coordinate.
`final int`
`hashCode()`
`boolean`
`intersects(ICurve c)`
Tests if this `ICurve` and the given `ICurve` intersect, i.e.
`boolean`
`overlaps(BezierCurve other)`
Checks if this `BezierCurve` and the given other `BezierCurve` overlap, i.e. an infinite set of intersection `Point`s exists.
`final boolean`
`overlaps(ICurve c)`
Tests if this `ICurve` and the given `ICurve` overlap, i.e.
`BezierCurve`
`rotateCCW(Angle angle)`
Directly rotates this `BezierCurve` counter-clockwise (CCW) around its center `Point` by the given `Angle`.
`BezierCurve`
`rotateCCW(Angle angle, double cx, double cy)`
Directly rotates this `BezierCurve` counter-clockwise (CCW) around the `Point` specified by the given x and y coordinate values by the given `Angle`.
`BezierCurve`
`rotateCCW(Angle angle, Point center)`
Directly rotates this `BezierCurve` counter-clockwise (CCW) around the given `Point` by the given `Angle`.
`BezierCurve`
`rotateCW(Angle angle)`
Directly rotates this `BezierCurve` clockwise (CW) around its center `Point` by the given `Angle`.
`BezierCurve`
`rotateCW(Angle angle, double cx, double cy)`
Directly rotates this `BezierCurve` clockwise (CW) around the `Point` specified by the given x and y coordinate values by the given `Angle`.
`BezierCurve`
`rotateCW(Angle angle, Point center)`
Directly rotates this `BezierCurve` clockwise (CW) around the given `Point` by the given `Angle`.
`BezierCurve`
`scale(double factor)`
Scales the calling object by the given factor relative to its center `Point`.
`BezierCurve`
`scale(double fx, double fy)`
Scales the calling object by the given factors relative to the given center `Point`.
`BezierCurve`
`scale(double factor, double cx, double cy)`
Scales the calling object by the given factor relative to the given center `Point` (cx, cy).
`BezierCurve`
`scale(double fx, double fy, double cx, double cy)`
Scales the calling object by the given factors relative to the given center `Point` (cx, cy).
`BezierCurve`
`scale(double fx, double fy, Point center)`
Scales the calling object by the given factors relative to the given center `Point`.
`BezierCurve`
`scale(double factor, Point center)`
Scales the calling object by the given factor relative to the given center `Point`.
`BezierCurve`
`setP1(Point p1)`
Sets the start `Point` of this `BezierCurve` to the given `Point`.
`BezierCurve`
`setP2(Point p2)`
Sets the end `Point` of this `BezierCurve` to the given `Point`.
`BezierCurve`
`setPoint(int i, Point p)`
Sets the ith control `Point` of this `BezierCurve`.
`BezierCurve[]`
`split(double t)`
Subdivides this `BezierCurve` at the given parameter value t into two new `BezierCurve`s.
`BezierCurve[]`
`toBezier()`
Computes a list of `BezierCurve`s that approximate the `ICurve`.
`CubicCurve`
`toCubic()`
Returns a hard approximation of this `BezierCurve` as a `CubicCurve`.
`Line`
`toLine()`
Returns a hard approximation of this `BezierCurve` as a `Line`.
`Line[]`
`toLineStrip(double lineSimilarity)`
Computes an approximation of this `BezierCurve` by a strip of `Line`s.
`Line[]`
`toLineStrip(double lineSimilarity, org.eclipse.gef.geometry.planar.BezierCurve.Interval startInterval)`
Computes an approximation of this `BezierCurve` by a strip of `Line`s.
`Path`
`toPath()`
Returns a `Path` approximating this `BezierCurve` using `Line` segments.
`Point[]`
`toPoints(org.eclipse.gef.geometry.planar.BezierCurve.Interval startInterval)`
Computes `Point`s on this `BezierCurve` over the given `BezierCurve.Interval`.
`QuadraticCurve`
`toQuadratic()`
Returns a hard approximation of this `BezierCurve` as a `QuadraticCurve`.
`String`
`toString()`
`boolean`
`touches(IGeometry g)`
Returns `true` if the input `IGeometry` touches this `IGeometry`, i.e. there is at least one common point.
`BezierCurve`
`translate(double dx, double dy)`
Translates the object by the given values in x and y direction.
`BezierCurve`
`translate(Point d)`
Translates the object by the given `Point`.

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.gef.geometry.planar.IGeometry

`touches`

## Constructor Details

### BezierCurve

public BezierCurve(CubicCurve c)
Constructs a new `BezierCurve` from the given `CubicCurve`.

Parameters:
  `c` - the `CubicCurve` of which the new `BezierCurve` is constructed from

### BezierCurve

public BezierCurve(double... controlPoints)
Constructs a new `BezierCurve` from the given control `Point` coordinates. The coordinates are expected to be in x, y order, i.e. x1, y1, x2, y2, x3, y3, ...

Parameters:
  `controlPoints` - the control `Point` coordinates of the new `BezierCurve` in x, y order

### BezierCurve

public BezierCurve(Point... controlPoints)
Constructs a new `BezierCurve` from the given control `Point` s.

Parameters:
  `controlPoints` - the control `Point`s of the new `BezierCurve`

### BezierCurve

public BezierCurve(QuadraticCurve c)
Constructs a new `BezierCurve` from the given `QuadraticCurve`.

Parameters:
  `c` - the `QuadraticCurve` of which the new `BezierCurve` is constructed from

## Method Details

### contains

public boolean contains(BezierCurve o)

Tests if this `BezierCurve` contains the given other `BezierCurve`.

The other `BezierCurve` is regarded to be contained by this `BezierCurve` if its start and end `Point` lie on this `BezierCurve` and an overlapping segment of the two curves can be detected.

Parameters:
  `o` - the `BezierCurve` that is checked to be contained by this `BezierCurve`
Returns:
  `true` if the given `BezierCurve` is contained by this `BezierCurve`, otherwise `false`

### contains

public boolean contains(Point p)
Description copied from interface: `IGeometry`
Returns whether the given `Point` is contained within this `IGeometry`. This includes the case that the `Point` lies on the border of this `IGeometry`.

Specified by:
  `contains` in interface `IGeometry`
Parameters:
  `p` - The `Point` being tested for containment
Returns:
  `true` if the `Point` is contained within this `IGeometry`, `false` otherwise.

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### get

public Point get(double t)
Computes the `Point` on this `BezierCurve` at parameter value t, which is expected to lie in the parameter `BezierCurve.Interval` `[0;1]`.

Parameters:
  `t` - the parameter value for which this `BezierCurve` is evaluated
Returns:
  the `Point` on this `BezierCurve` at the given parameter value

### getBounds

public Rectangle getBounds()
Description copied from interface: `IGeometry`
Returns the smallest `Rectangle` fully enclosing this `IGeometry`.

Specified by:
  `getBounds` in interface `IGeometry`
Returns:
  A new `Rectangle` object that fully encloses this `IGeometry`

### getClipped

public BezierCurve getClipped(double s, double e)
Returns a new `BezierCurve` object representing this `BezierCurve` on the `BezierCurve.Interval` `[s;e]`.

Parameters:
  `s` - the lower limit of the parameter `BezierCurve.Interval` which is clipped out of this `BezierCurve`
  `e` - the upper limit of the parameter `BezierCurve.Interval` which is clipped out of this `BezierCurve`
Returns:
  a new `BezierCurve` representing this `BezierCurve` on the `BezierCurve.Interval` `[s;e]`

### getControlBounds

public Rectangle getControlBounds()
Returns a bounding `Rectangle` of the control `Polygon` of this `BezierCurve`.

Returns:
  a `Rectangle` representing the bounds of the control `Polygon` of this `BezierCurve`

### getCopy

public BezierCurve getCopy()
Description copied from interface: `IGeometry`
Returns a new identical copy of this `IGeometry`.

Specified by:
  `getCopy` in interface `IGeometry`
Returns:
  a copy identical to this `IGeometry`

### getDerivative

public BezierCurve getDerivative()
Computes the hodograph, the first parametric derivative, of this `BezierCurve`.

Returns:
  the hodograph of this `BezierCurve`

### getElevated

public BezierCurve getElevated()
Computes a `BezierCurve` with a degree of one higher than this `BezierCurve`'s degree but of the same shape.

Returns:
  a `BezierCurve` of the same shape as this `BezierCurve` but with one more control `Point`

### getIntersections

public Point[] getIntersections(BezierCurve other)
Returns the `Point`s of intersection of this and the given other `BezierCurve`.

Parameters:
  `other` - the `BezierCurve` which is searched for `Point`s of intersection with this `BezierCurve`
Returns:
  the `Point`s of intersection of this `BezierCurve` and the given other `BezierCurve`

### getIntersections

public final Point[] getIntersections(ICurve curve)
Description copied from interface: `ICurve`
Returns the points of intersection between this `ICurve` and the given `ICurve`.

Specified by:
  `getIntersections` in interface `ICurve`
Parameters:
  `curve` - The `ICurve` to compute intersection points with.
Returns:
  The points of intersection.

### getOffset

public PolyBezier getOffset(double distance)
Returns a `PolyBezier` that represents an approximation of the refined offset of this `BezierCurve` where cusps in the input curve are approximated by arc segments in the offset and local self-intersections in the offset are removed while global self-intersections and other singularities in the offset remain unprocessed.

Parameters:
  `distance` - The signed distance for which to compute a refined offset approximation.
Returns:
  A `PolyBezier` representing the refined offset of this `BezierCurve` for the given distance.

### getOverlap

public BezierCurve getOverlap(BezierCurve other)

Returns a `BezierCurve` that represents the overlap of this `BezierCurve` and the given other `BezierCurve`. If no overlap exists, `null` is returned. An overlap is identified by an infinite number of intersection points.

Parameters:
  `other` - The `BezierCurve` to which an overlap is computed.
Returns:
  a `BezierCurve` representing the overlap of this and the given other `BezierCurve` if an overlap exists, otherwise `null`

### getOverlaps

public final ICurve[] getOverlaps(ICurve c)
Description copied from interface: `ICurve`
Returns the curve segments at which this `ICurve` and the given `ICurve` overlap.

Specified by:
  `getOverlaps` in interface `ICurve`
Parameters:
  `c` - The curve to compute overlaps with.
Returns:
  The segments where both curves overlap.

### getP1

public Point getP1()
Description copied from interface: `ICurve`
Returns a `Point` representing the start point of this `ICurve`.

Specified by:
  `getP1` in interface `ICurve`
Returns:
  a new `Point` with the coordinates of the `ICurve`'s start point.

### getP2

public Point getP2()
Description copied from interface: `ICurve`
Returns a `Point` representing the end point of this `ICurve` .

Specified by:
  `getP2` in interface `ICurve`
Returns:
  a new `Point` with the coordinates of the `ICurve`'s end point.

### getParameterAt

public double getParameterAt(Point p)
Returns the parameter value of this `BezierCurve` for the given `Point`. If the given `Point` is not on this `BezierCurve` an `IllegalArgumentException` is thrown.

Parameters:
  `p` - the `Point` for which the parameter value on this `BezierCurve` is to be found
Returns:
  the corresponding parameter value of the given `Point` on this `BezierCurve`

### getPoint

public Point getPoint(int i)
Returns the ith control `Point` of this `BezierCurve`. The start `Point` is at index `0`, the first handle- `Point` is at index `1`, etc.

Parameters:
  `i` - the index of the control `Point` of this `BezierCurve` to return
Returns:
  the ith control `Point` of this `BezierCurve`

### getPoints

public Point[] getPoints()
Returns the control `Point`s of this `BezierCurve`.

Returns:
  the control `Point`s of this `BezierCurve`

### getProjection

public Point getProjection(Point reference)
Description copied from interface: `ICurve`
Returns a projection of the given reference `Point` onto this `ICurve`, i.e. a `Point` on this `ICurve` that is closest to the given reference `Point`. Note, that

Specified by:
  `getProjection` in interface `ICurve`
Parameters:
  `reference` - The reference `Point` for which to return the projection.
Returns:
  The projection of the given reference `Point` onto this `ICurve`.

### getRotatedCCW

public BezierCurve getRotatedCCW(Angle angle)
Description copied from interface: `IRotatable`
Rotates the calling object by specified `Angle` counter-clock-wise (CCW) around its center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCCW` in interface `IRotatable<BezierCurve>`
Parameters:
  `angle` - rotation `Angle`
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCCW

public BezierCurve getRotatedCCW(Angle angle, double cx, double cy)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point` (cx, cy). Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCCW` in interface `IRotatable<BezierCurve>`
Parameters:
  `angle` - rotation `Angle`
  `cx` - x-coordinate of the relative `Point` for the rotation
  `cy` - y-coordinate of the relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCCW

public BezierCurve getRotatedCCW(Angle angle, Point center)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCCW` in interface `IRotatable<BezierCurve>`
Parameters:
  `angle` - rotation `Angle`
  `center` - relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCW

public BezierCurve getRotatedCW(Angle angle)
Description copied from interface: `IRotatable`
Rotates the calling object by specified `Angle` clock-wise (CW) around its center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCW` in interface `IRotatable<BezierCurve>`
Parameters:
  `angle` - rotation `Angle`
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCW

public BezierCurve getRotatedCW(Angle angle, double cx, double cy)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point` (cx, cy). Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCW` in interface `IRotatable<BezierCurve>`
Parameters:
  `angle` - rotation `Angle`
  `cx` - x-coordinate of the relative `Point` for the rotation
  `cy` - y-coordinate of the relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCW

public BezierCurve getRotatedCW(Angle angle, Point center)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCW` in interface `IRotatable<BezierCurve>`
Parameters:
  `angle` - rotation `Angle`
  `center` - relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getScaled

public BezierCurve getScaled(double factor)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factor relative to its center `Point`.

Specified by:
  `getScaled` in interface `IScalable<BezierCurve>`
Parameters:
  `factor` - scale-factor
Returns:
  the new, scaled object

### getScaled

public BezierCurve getScaled(double fx, double fy)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factors relative to its center `Point`.

Specified by:
  `getScaled` in interface `IScalable<BezierCurve>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
Returns:
  the new, scaled object

### getScaled

public BezierCurve getScaled(double factor, double cx, double cy)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factor relative to the given center `Point` (cx, cy).

Specified by:
  `getScaled` in interface `IScalable<BezierCurve>`
Parameters:
  `factor` - scale-factor
  `cx` - x-coordinate of the relative `Point` for the scaling
  `cy` - y-coordinate of the relative `Point` for the scaling
Returns:
  the new, scaled object

### getScaled

public BezierCurve getScaled(double fx, double fy, double cx, double cy)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factors relative to the given center `Point` (cx, cy).

Specified by:
  `getScaled` in interface `IScalable<BezierCurve>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
  `cx` - x-coordinate of the relative `Point` for the scaling
  `cy` - y-coordinate of the relative `Point` for the scaling
Returns:
  the new, scaled object

### getScaled

public BezierCurve getScaled(double fx, double fy, Point center)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factors relative to the given center `Point`.

Specified by:
  `getScaled` in interface `IScalable<BezierCurve>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
  `center` - relative `Point` for the scaling
Returns:
  the new, scaled object

### getScaled

public BezierCurve getScaled(double factor, Point center)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factor relative to the given center `Point`.

Specified by:
  `getScaled` in interface `IScalable<BezierCurve>`
Parameters:
  `factor` - scale-factor
  `center` - relative `Point` for the scaling
Returns:
  the new, scaled object

### getTransformed

public BezierCurve getTransformed(AffineTransform t)
Default implementation returning a transformed `Path` representation of this `IGeometry`. Subclasses may override this method to return a more specific representation.

Specified by:
  `getTransformed` in interface `IGeometry`
Parameters:
  `t` - The `AffineTransform` to be applied
Returns:
  a transformed `Path` representation of this `IGeometry`
See Also:
  - `IGeometry.getTransformed(AffineTransform)`

### getTranslated

public BezierCurve getTranslated(double dx, double dy)
Description copied from interface: `ITranslatable`
Translates a copy of this object by the given values in x and y direction.

Specified by:
  `getTranslated` in interface `ITranslatable<BezierCurve>`
Parameters:
  `dx` - x-translation
  `dy` - y-translation
Returns:
  a new, translated object

### getTranslated

public BezierCurve getTranslated(Point d)
Description copied from interface: `ITranslatable`
Translates a copy of this object by the given `Point`.

Specified by:
  `getTranslated` in interface `ITranslatable<BezierCurve>`
Parameters:
  `d` - translation `Point`
Returns:
  a new, translated object

### getX1

public double getX1()
Description copied from interface: `ICurve`
Returns the start `Point`'s x coordinate.

Specified by:
  `getX1` in interface `ICurve`
Returns:
  the start `Point`'s x coordinate

### getX2

public double getX2()
Description copied from interface: `ICurve`
Returns the end `Point`'s x coordinate.

Specified by:
  `getX2` in interface `ICurve`
Returns:
  the end `Point`'s x coordinate

### getY1

public double getY1()
Description copied from interface: `ICurve`
Returns the start `Point`'s y coordinate.

Specified by:
  `getY1` in interface `ICurve`
Returns:
  the start `Point`'s y coordinate

### getY2

public double getY2()
Description copied from interface: `ICurve`
Returns the end `Point`'s y coordinate.

Specified by:
  `getY2` in interface `ICurve`
Returns:
  the end `Point`'s y coordinate

### intersects

public boolean intersects(ICurve c)
Description copied from interface: `ICurve`
Tests if this `ICurve` and the given `ICurve` intersect, i.e. whether a final set of intersection points exists. Two curves intersect if they touch (see `IGeometry.touches(IGeometry)`) but do not overlap (see `ICurve.overlaps(ICurve)`).

Specified by:
  `intersects` in interface `ICurve`
Parameters:
  `c` - The `ICurve` to test for intersections.
Returns:
  `true` if they intersect, `false` otherwise

### overlaps

public boolean overlaps(BezierCurve other)
Checks if this `BezierCurve` and the given other `BezierCurve` overlap, i.e. an infinite set of intersection `Point`s exists.

Parameters:
  `other` - the `BezierCurve` to check for an overlapping segment with this `BezierCurve`
Returns:
  `true` if this and the given other `BezierCurve` overlap, otherwise `false`

### overlaps

public final boolean overlaps(ICurve c)
Description copied from interface: `ICurve`
Tests if this `ICurve` and the given `ICurve` overlap, i.e. whether an infinite set of intersection points exists. Two curves overlap if they touch (see `IGeometry.touches(IGeometry)`) but not intersect (see `ICurve.intersects(ICurve)`).

Specified by:
  `overlaps` in interface `ICurve`
Parameters:
  `c` - The `ICurve` to test for overlap.
Returns:
  `true` if they overlap, `false` otherwise

### rotateCCW

public BezierCurve rotateCCW(Angle angle)
Directly rotates this `BezierCurve` counter-clockwise (CCW) around its center `Point` by the given `Angle`. Direct adaptation means, that `this` `BezierCurve` is modified in-place.

Parameters:
  `angle` - the rotation `Angle`
Returns:
  `this` for convenience

### rotateCCW

public BezierCurve rotateCCW(Angle angle, double cx, double cy)
Directly rotates this `BezierCurve` counter-clockwise (CCW) around the `Point` specified by the given x and y coordinate values by the given `Angle`. Direct adaptation means, that `this` `BezierCurve` is modified in-place.

Parameters:
  `angle` - the rotation `Angle`
  `cx` - the x coordinate of the `Point` to rotate around
  `cy` - the y coordinate of the `Point` to rotate around
Returns:
  `this` for convenience

### rotateCCW

public BezierCurve rotateCCW(Angle angle, Point center)
Directly rotates this `BezierCurve` counter-clockwise (CCW) around the given `Point` by the given `Angle`. Direct adaptation means, that `this` `BezierCurve` is modified in-place.

Parameters:
  `angle` - the rotation `Angle`
  `center` - the `Point` to rotate around
Returns:
  `this` for convenience

### rotateCW

public BezierCurve rotateCW(Angle angle)
Directly rotates this `BezierCurve` clockwise (CW) around its center `Point` by the given `Angle`. Direct adaptation means, that `this` `BezierCurve` is modified in-place.

Parameters:
  `angle` - the rotation `Angle`
Returns:
  `this` for convenience

### rotateCW

public BezierCurve rotateCW(Angle angle, double cx, double cy)
Directly rotates this `BezierCurve` clockwise (CW) around the `Point` specified by the given x and y coordinate values by the given `Angle`. Direct adaptation means, that `this` `BezierCurve` is modified in-place.

Parameters:
  `angle` - the rotation `Angle`
  `cx` - the x coordinate of the `Point` to rotate around
  `cy` - the y coordinate of the `Point` to rotate around
Returns:
  `this` for convenience

### rotateCW

public BezierCurve rotateCW(Angle angle, Point center)
Directly rotates this `BezierCurve` clockwise (CW) around the given `Point` by the given `Angle`. Direct adaptation means, that `this` `BezierCurve` is modified in-place.

Parameters:
  `angle` - the rotation `Angle`
  `center` - the `Point` to rotate around
Returns:
  `this` for convenience

### scale

public BezierCurve scale(double factor)
Description copied from interface: `IScalable`
Scales the calling object by the given factor relative to its center `Point`.

Specified by:
  `scale` in interface `IScalable<BezierCurve>`
Parameters:
  `factor` - scale-factor
Returns:
  `this` for convenience

### scale

public BezierCurve scale(double fx, double fy)
Description copied from interface: `IScalable`
Scales the calling object by the given factors relative to the given center `Point`.

Specified by:
  `scale` in interface `IScalable<BezierCurve>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
Returns:
  `this` for convenience

### scale

public BezierCurve scale(double factor, double cx, double cy)
Description copied from interface: `IScalable`
Scales the calling object by the given factor relative to the given center `Point` (cx, cy).

Specified by:
  `scale` in interface `IScalable<BezierCurve>`
Parameters:
  `factor` - scale-factor
  `cx` - x-coordinate of the relative `Point` for the scaling
  `cy` - y-coordinate of the relative `Point` for the scaling
Returns:
  `this` for convenience

### scale

public BezierCurve scale(double fx, double fy, double cx, double cy)
Description copied from interface: `IScalable`
Scales the calling object by the given factors relative to the given center `Point` (cx, cy).

Specified by:
  `scale` in interface `IScalable<BezierCurve>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
  `cx` - x-coordinate of the relative `Point` for the scaling
  `cy` - y-coordinate of the relative `Point` for the scaling
Returns:
  `this` for convenience

### scale

public BezierCurve scale(double fx, double fy, Point center)
Description copied from interface: `IScalable`
Scales the calling object by the given factors relative to the given center `Point`.

Specified by:
  `scale` in interface `IScalable<BezierCurve>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
  `center` - relative `Point` for the scaling
Returns:
  `this` for convenience

### scale

public BezierCurve scale(double factor, Point center)
Description copied from interface: `IScalable`
Scales the calling object by the given factor relative to the given center `Point`.

Specified by:
  `scale` in interface `IScalable<BezierCurve>`
Parameters:
  `factor` - scale-factor
  `center` - relative `Point` for the scaling
Returns:
  `this` for convenience

### setP1

public BezierCurve setP1(Point p1)
Sets the start `Point` of this `BezierCurve` to the given `Point`.

Parameters:
  `p1` - the new start `Point` of this `BezierCurve`
Returns:
  `this` for convenience

### setP2

public BezierCurve setP2(Point p2)
Sets the end `Point` of this `BezierCurve` to the given `Point`.

Parameters:
  `p2` - the new end `Point` of this `BezierCurve`
Returns:
  `this` for convenience

### setPoint

public BezierCurve setPoint(int i, Point p)
Sets the ith control `Point` of this `BezierCurve`. The start `Point` is at index `0`, the first handle- `Point` is at index `1`, etc.

Parameters:
  `i` - the index of the control `Point` of this `BezierCurve` to set
  `p` - the new control `Point` at the given index
Returns:
  `this` for convenience

### split

public BezierCurve[] split(double t)
Subdivides this `BezierCurve` at the given parameter value t into two new `BezierCurve`s. The first one is the `BezierCurve` over the parameter `BezierCurve.Interval` `[0;t]` and the second one is the `BezierCurve` over the parameter `BezierCurve.Interval` `[t;1]`.

Parameters:
  `t` - the parameter value at which this `BezierCurve` is subdivided
Returns:
  an array of two `BezierCurve`s, the left ( `[0;t]`) and the right (`[t;1]`)

### toBezier

public BezierCurve[] toBezier()
Description copied from interface: `ICurve`
Computes a list of `BezierCurve`s that approximate the `ICurve`. For example, a `Line` or a `BezierCurve` in general could return a list with the curve itself as its only element. But an `Ellipse` or an `Arc` may return a list of consecutive `BezierCurve`s which approximate the `ICurve`.

Specified by:
  `toBezier` in interface `ICurve`
Returns:
  a list of `BezierCurve`s that approximate the `ICurve`

### toCubic

public CubicCurve toCubic()
Returns a hard approximation of this `BezierCurve` as a `CubicCurve`. The new `CubicCurve` is constructed from the start `Point`, the first two handle `Point`s and the end `Point` of this `BezierCurve`. If this `BezierCurve` is not of degree four or higher, i.e. it does not have four or more control `Point`s (including start and end `Point`), `null` is returned.

Returns:
  a new `CubicCurve` that is constructed from the start `Point`, the first two handle `Point`s and the end `Point` of this `BezierCurve` or `null` if this `BezierCurve` does not have at least four control `Point`s

### toLine

public Line toLine()
Returns a hard approximation of this `BezierCurve` as a `Line`. The `Line` is constructed from the start and end `Point` of this `BezierCurve`.

Returns:
  a `Line` from the start `Point` to the end `Point` of this `BezierCurve` or `null` if this `BezierCurve` does only have one control `Point`

### toLineStrip

public Line[] toLineStrip(double lineSimilarity)
Computes an approximation of this `BezierCurve` by a strip of `Line`s. For detailed information on how the approximation is computed, see `toLineStrip(double, Interval)`.

Parameters:
  `lineSimilarity` - the threshold for the sum of the distances of the control `Point`s to the baseline (`toLine()`) of this `BezierCurve`
Returns:
  an approximation of this `BezierCurve` by a strip of `Line`s
See Also:
  - `toLineStrip(double, Interval)`

### toLineStrip

public Line[] toLineStrip(double lineSimilarity, org.eclipse.gef.geometry.planar.BezierCurve.Interval startInterval)

Computes an approximation of this `BezierCurve` by a strip of `Line`s.

The `BezierCurve` is recursively subdivided until it is "similar" to a straight `Line`. The similarity check computes the sum of the distances of the control `Point`s to the baseline ( `toLine()`) of this `BezierCurve`. If this sum is smaller than the given lineSimilarity, the `BezierCurve` is assumed to be "similar" to a straight line.

Parameters:
  `lineSimilarity` - the threshold for the sum of the distances of the control points to the baseline of this `BezierCurve`
  `startInterval` - the `BezierCurve.Interval` of this `BezierCurve` that has to be approximated by a strip of `Line`s
Returns:
  `Line` segments approximating this `BezierCurve`

### toPath

public Path toPath()
Returns a `Path` approximating this `BezierCurve` using `Line` segments.

Specified by:
  `toPath` in interface `IGeometry`
Returns:
  a `Path` approximating this `BezierCurve` using `Line` segments

### toPoints

public Point[] toPoints(org.eclipse.gef.geometry.planar.BezierCurve.Interval startInterval)
Computes `Point`s on this `BezierCurve` over the given `BezierCurve.Interval`. Consecutive returned `Point`s are required to be `equal` to each other.

Parameters:
  `startInterval` - the `BezierCurve.Interval` of this `BezierCurve` to calculate `Point`s for
Returns:
  `Point`s on this `BezierCurve` over the given parameter `BezierCurve.Interval` where consecutive `Point`s are `equal` to each other

### toQuadratic

public QuadraticCurve toQuadratic()
Returns a hard approximation of this `BezierCurve` as a `QuadraticCurve`. The new `QuadraticCurve` is constructed from the start `Point`, the first handle `Point` and the end `Point` of this `BezierCurve`. If this `BezierCurve` is not of degree three or higher, i.e. it does not have three or more control `Point`s (including start and end `Point`), `null` is returned.

Returns:
  a new `QuadraticCurve` that is constructed from the start `Point`, the first handle `Point` and the end `Point` of this `BezierCurve` or `null` if this `BezierCurve` does not have at least three control `Point`s

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### translate

public BezierCurve translate(double dx, double dy)
Description copied from interface: `ITranslatable`
Translates the object by the given values in x and y direction.

Specified by:
  `translate` in interface `ITranslatable<BezierCurve>`
Parameters:
  `dx` - x-translation
  `dy` - y-translation
Returns:
  `this` for convenience

### translate

public BezierCurve translate(Point d)
Description copied from interface: `ITranslatable`
Translates the object by the given `Point`.

Specified by:
  `translate` in interface `ITranslatable<BezierCurve>`
Parameters:
  `d` - translation `Point`
Returns:
  `this` for convenience

### clone

public Object clone()
Overridden with public visibility as recommended within `Cloneable` .

Overrides:
  `clone` in class `Object`

### hashCode

public final int hashCode()

Overrides:
  `hashCode` in class `Object`
See Also:
  - `Object.hashCode()`

### touches

public boolean touches(IGeometry g)
Description copied from interface: `IGeometry`
Returns `true` if the input `IGeometry` touches this `IGeometry`, i.e. there is at least one common point.

Specified by:
  `touches` in interface `IGeometry`
Parameters:
  `g` - The `IGeometry` for the intersection test
Returns:
  `true` if the input `IGeometry` and this `IGeometry` have at least one common point.