pythagoras.d

## Class CubicCurve

• ### Field Summary

Fields
Modifier and Type Field and Description
`double` `ctrlx1`
The x-coordinate of the first control point.
`double` `ctrlx2`
The x-coordinate of the second control point.
`double` `ctrly1`
The y-coordinate of the first control point.
`double` `ctrly2`
The x-coordinate of the second control point.
`double` `x1`
The x-coordinate of the start of this curve.
`double` `x2`
The x-coordinate of the end of this curve.
`double` `y1`
The y-coordinate of the start of this curve.
`double` `y2`
The y-coordinate of the end of this curve.
• ### Constructor Summary

Constructors
Constructor and Description
`CubicCurve()`
Creates a cubic curve with all points at (0,0).
```CubicCurve(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)```
Creates a cubic curve with the specified start, control, and end points.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`double` `ctrlX1()`
Returns the x-coordinate of the first control point.
`double` `ctrlX2()`
Returns the x-coordinate of the second control point.
`double` `ctrlY1()`
Returns the y-coordinate of the first control point.
`double` `ctrlY2()`
Returns the y-coordinate of the second control point.
`void` ```setCurve(double[] coords, int offset)```
Configures the start, control and end points for this curve, using the values at the specified offset in the `coords` array.
`void` ```setCurve(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)```
Configures the start, control and end points for this curve.
`void` `setCurve(ICubicCurve curve)`
Configures the start, control and end points for this curve to be the same as the supplied curve.
`void` ```setCurve(XY[] points, int offset)```
Configures the start, control and end points for this curve, using the values at the specified offset in the `points` array.
`void` ```setCurve(XY p1, XY cp1, XY cp2, XY p2)```
Configures the start, control and end points for this curve.
`double` `x1()`
Returns the x-coordinate of the start of this curve.
`double` `x2()`
Returns the x-coordinate of the end of this curve.
`double` `y1()`
Returns the y-coordinate of the start of this curve.
`double` `y2()`
Returns the y-coordinate of the end of this curve.
• ### Methods inherited from class pythagoras.d.AbstractCubicCurve

`bounds, bounds, clone, contains, contains, contains, contains, ctrlP1, ctrlP2, flatness, flatnessSq, intersects, intersects, isEmpty, p1, p2, pathIterator, pathIterator, subdivide`
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### x1

`public double x1`
The x-coordinate of the start of this curve.
• #### y1

`public double y1`
The y-coordinate of the start of this curve.
• #### ctrlx1

`public double ctrlx1`
The x-coordinate of the first control point.
• #### ctrly1

`public double ctrly1`
The y-coordinate of the first control point.
• #### ctrlx2

`public double ctrlx2`
The x-coordinate of the second control point.
• #### ctrly2

`public double ctrly2`
The x-coordinate of the second control point.
• #### x2

`public double x2`
The x-coordinate of the end of this curve.
• #### y2

`public double y2`
The y-coordinate of the end of this curve.
• ### Constructor Detail

• #### CubicCurve

`public CubicCurve()`
Creates a cubic curve with all points at (0,0).
• #### CubicCurve

```public CubicCurve(double x1,
double y1,
double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double x2,
double y2)```
Creates a cubic curve with the specified start, control, and end points.
• ### Method Detail

• #### setCurve

```public void setCurve(double x1,
double y1,
double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double x2,
double y2)```
Configures the start, control and end points for this curve.
• #### setCurve

```public void setCurve(XY p1,
XY cp1,
XY cp2,
XY p2)```
Configures the start, control and end points for this curve.
• #### setCurve

```public void setCurve(double[] coords,
int offset)```
Configures the start, control and end points for this curve, using the values at the specified offset in the `coords` array.
• #### setCurve

```public void setCurve(XY[] points,
int offset)```
Configures the start, control and end points for this curve, using the values at the specified offset in the `points` array.
• #### setCurve

`public void setCurve(ICubicCurve curve)`
Configures the start, control and end points for this curve to be the same as the supplied curve.
• #### x1

`public double x1()`
Description copied from interface: `ICubicCurve`
Returns the x-coordinate of the start of this curve.
Specified by:
`x1` in interface `ICubicCurve`
• #### y1

`public double y1()`
Description copied from interface: `ICubicCurve`
Returns the y-coordinate of the start of this curve.
Specified by:
`y1` in interface `ICubicCurve`
• #### ctrlX1

`public double ctrlX1()`
Description copied from interface: `ICubicCurve`
Returns the x-coordinate of the first control point.
Specified by:
`ctrlX1` in interface `ICubicCurve`
• #### ctrlY1

`public double ctrlY1()`
Description copied from interface: `ICubicCurve`
Returns the y-coordinate of the first control point.
Specified by:
`ctrlY1` in interface `ICubicCurve`
• #### ctrlX2

`public double ctrlX2()`
Description copied from interface: `ICubicCurve`
Returns the x-coordinate of the second control point.
Specified by:
`ctrlX2` in interface `ICubicCurve`
• #### ctrlY2

`public double ctrlY2()`
Description copied from interface: `ICubicCurve`
Returns the y-coordinate of the second control point.
Specified by:
`ctrlY2` in interface `ICubicCurve`
• #### x2

`public double x2()`
Description copied from interface: `ICubicCurve`
Returns the x-coordinate of the end of this curve.
Specified by:
`x2` in interface `ICubicCurve`
• #### y2

`public double y2()`
Description copied from interface: `ICubicCurve`
Returns the y-coordinate of the end of this curve.
Specified by:
`y2` in interface `ICubicCurve`