The QCurve
class enhances the QuadCurve.Double
class (from the java.awt.geom
package) by allowing entities to move along such quadratic curves as well as lines. Although the curve could be developed as a quadratic function where y = ax^2 + bx + c. The following quadratic bezier formulation is used: p(t) = (x(t), y(t)) = [(1-t)^2 * p1] + [2 * (1-t) * t * pc] + [t^2 * p2].
Value parameters
- p1
-
the starting point for the quad curve
- p2
-
the ending point for the quad curve
- pc
-
the control point for the quad curve
- straight
-
whether the quad curve is straight (i.e., a line)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Producttrait Equalstrait CurvilinearShapeclass Doubletrait Serializableclass QuadCurve2Dtrait Cloneabletrait Shapeclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Constructors
Construct a straight line (degenerate quad curve).
Construct a straight line (degenerate quad curve).
Value parameters
- _p1
-
the starting point
- _p2
-
the ending point
Attributes
Construct a quad curve where bend indicates the distance to the control point.
Construct a quad curve where bend indicates the distance to the control point.
Value parameters
- _p1
-
the starting point
- _p2
-
the ending point
- bend
-
the bend or curvature (1. => line length)
Attributes
Concrete methods
Given a value for the trajectory parameter 't' (in [0., 1.]) calculate the point on the curve using the Quadratic Bezier equation.
Given a value for the trajectory parameter 't' (in [0., 1.]) calculate the point on the curve using the Quadratic Bezier equation.
Attributes
- See also
-
en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves
Get the x-coordinate of the center of the line/curve.
Get the x-coordinate of the center of the line/curve.
Attributes
Get the y-coordinate of the center of the line/curve.
Get the y-coordinate of the center of the line/curve.
Attributes
Get the control point of the quad curve.
Get the control point of the quad curve.
Attributes
Get the first/start point of the quad curve.
Get the first/start point of the quad curve.
Attributes
Get the first/start point of the quad curve, adjusted from top-left to center coordinates.
Get the first/start point of the quad curve, adjusted from top-left to center coordinates.
Value parameters
- height
-
the height of object traversing the curve
- width
-
the width of object traversing the curve
Attributes
Get the last/end-point of the quad curve.
Get the last/end-point of the quad curve.
Attributes
Get the last/end-point of the quad curve, adjusted from top-left to center coordinates.
Get the last/end-point of the quad curve, adjusted from top-left to center coordinates.
Value parameters
- height
-
the height of object traversing the curve
- width
-
the width of object traversing the curve
Attributes
Whether ('x', 'y') and ('xe', 'ye') are essentially the same.
Whether ('x', 'y') and ('xe', 'ye') are essentially the same.
Attributes
Return the length of this QCurve
.
Return the length of this QCurve
.
Attributes
Return the next point on the quad curve (one step beyond current point). Return null if 't > 1.0' (i.e., past end-point).
Return the next point on the quad curve (one step beyond current point). Return null if 't > 1.0' (i.e., past end-point).
Attributes
Return the next point on the quad curve (one step beyond current point) and adjust from top-left to center coordinates for the object traversing the curve based on its width and height. Return null if 't > 1.0' (i.e., past end-point).
Return the next point on the quad curve (one step beyond current point) and adjust from top-left to center coordinates for the object traversing the curve based on its width and height. Return null if 't > 1.0' (i.e., past end-point).
Value parameters
- height
-
the height of object traversing the curve
- width
-
the width of object traversing the curve
Attributes
- Definition Classes
Set (or reset) the location for the QCurve
as a line.
Set (or reset) the location for the QCurve
as a line.
Value parameters
- _p1
-
the starting point
- _p2
-
the ending point
Attributes
Set (or reset) the location for the QCurve
as a curve using bend to calculate the control point.
Set (or reset) the location for the QCurve
as a curve using bend to calculate the control point.
Value parameters
- _p1
-
the starting point
- _p2
-
the ending point
- bend
-
the bend or curvature (1. => line-length)
Attributes
Set (or reset) the location for the QCurve
as a curve using an explicitly given control point.
Set (or reset) the location for the QCurve
as a curve using an explicitly given control point.
Value parameters
- _p1
-
the starting point
- _p2
-
the ending point
- _pc
-
the control point
Attributes
- Definition Classes
Set the number of steps for tokens to take as move along the quad curve.
Set the number of steps for tokens to take as move along the quad curve.
Value parameters
- steps
-
the number of steps to take along the quad curve
Attributes
Show the start, control and end-points of the the QCurve
.
Show the start, control and end-points of the the QCurve
.
Attributes
- Definition Classes
-
Any
Get the current trajectory '_traj' of the curve.
Get the current trajectory '_traj' of the curve.
Attributes
Set the trajectory '_traj' to a new value.
Set the trajectory '_traj' to a new value.
Value parameters
- traj
-
the new trajectory for the curve
Attributes
Inherited methods
Create a copy of the receiver object.
Create a copy of the receiver object.
The default implementation of the clone
method is platform dependent.
Attributes
- Returns
-
a copy of the receiver object.
- Note
-
not specified by SLS as a member of AnyRef
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- QuadCurve2D
Attributes
- Inherited from:
- CurvilinearShape
Attributes
- Inherited from:
- CurvilinearShape
Attributes
- Inherited from:
- CurvilinearShape
Attributes
- Inherited from:
- QuadCurve2D
Concrete fields
Trajectory parameter t ranges from 0. to 1. (indicates how far along the curve)
Trajectory parameter t ranges from 0. to 1. (indicates how far along the curve)
Attributes
Inherited fields
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double
Attributes
- Inherited from:
- Double