Class PathSegment.Float

    • Constructor Detail

      • Float

        public Float(float moveX,
                     float moveY)
        Initializes a SEG_MOVETO segment. This is the only publicly available constructor: to add other segments you should use the methods lineTo, cubicTo, etc.
        Parameters:
        moveX -
        moveY -
      • Float

        protected Float()
        This constructor does not initialize anything.
    • Method Detail

      • newSegment

        protected PathSegment.Float newSegment()
        Subclasses must override this method to return a segment of the correct type.
      • getXCoeffs

        public float[] getXCoeffs()
      • getYCoeffs

        public float[] getYCoeffs()
      • getTheta

        public float getTheta(float t,
                              AffineTransform transform,
                              boolean confine)
        Returns the tangent angle at the point t.
        Parameters:
        t - the t-value to get the tangent angle for.
        confine - this may confine the result to [-pi/2,pi/2]. If this is false, then the result may range from [-pi,pi].
        Returns:
        the tangent angle (in radians).
      • isThetaWellDefined

        public boolean isThetaWellDefined(float t)
      • getTheta

        public float getTheta(float t,
                              AffineTransform transform,
                              int direction)
        Returns the tangent angle at the point t.
        Parameters:
        t - the t-value to get the tangent angle for.
        direction - in the (extremely) rare case where the tangent slope is ambiguous, this indicates which side of the t argument to look at. That is, if you approach t from a smaller value, the angle might be K. If you approach t from a larger value, the angle might be (K+pi). This will happen when the direction of the curve is undefined at t, because the curve is switching from K to (K+pi). When this argument is positive, it assumes t is being approached by values greater than t. When negative, it assumes t is approached from values less than t.
        Returns:
        the tangent angle (in radians).
      • getX

        public float getX(float t)
      • getY

        public float getY(float t)
      • toString

        public String toString()
      • cubicTo

        public PathSegment.Float cubicTo(float cx0,
                                         float cy0,
                                         float cx1,
                                         float cy1,
                                         float x1,
                                         float y1)
      • rotate

        public void rotate(float f)