iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

SCIBezierCurveInterpolator

@interface SCIBezierCurveInterpolator : NSObject

Helper class which allows to interpolate value for cubic bezier curve.

  • The start point of the bezier curve.

    Declaration

    Objective-C

    @property (nonatomic) CGPoint start;

    Swift

    var start: CGPoint { get set }
  • a

    The a control point of the bezier curve.

    Declaration

    Objective-C

    @property (nonatomic) CGPoint a;

    Swift

    var a: CGPoint { get set }
  • b

    The b control point of the bezier curve.

    Declaration

    Objective-C

    @property (nonatomic) CGPoint b;

    Swift

    var b: CGPoint { get set }
  • end

    The start point of the bezier curve.

    Declaration

    Objective-C

    @property (nonatomic) CGPoint end;

    Swift

    var end: CGPoint { get set }
  • Gets interpolated y values for specified x value.

    Declaration

    Objective-C

    - (float)getYForX:(float)x;

    Swift

    func getYFor(x: Float) -> Float

    Parameters

    x

    The x value.

    Return Value

    The interpolated y value.

  • Calculates approximate length of the bezier curve

    Declaration

    Objective-C

    - (float)calculateApproximatedLength;

    Swift

    func calculateApproximatedLength() -> Float

    Return Value

    The length of bezier curve

  • Splits bezier curve at specified t.

    Declaration

    Objective-C

    - (void)divideCurveAtT:(float)t
                  subStart:(nonnull CGPoint *)subStart
                      subA:(nonnull CGPoint *)subA
                      subB:(nonnull CGPoint *)subB
                    subEnd:(nonnull CGPoint *)subEnd;

    Swift

    func divideCurve(atT t: Float, subStart: UnsafeMutablePointer<CGPoint>, subA: UnsafeMutablePointer<CGPoint>, subB: UnsafeMutablePointer<CGPoint>, subEnd: UnsafeMutablePointer<CGPoint>)

    Parameters

    t

    The t values from 0 to 1 to split curve at.

    subStart

    The start point of sub curve.

    subA

    The a control point of sub curve.

    subB

    The b control point of sub curve.

    subEnd

    The end point of sub curve.