Getting coefficients for PathCubic?



  • Hi,

    I would like to compute dependent variable based on independent variable from cubic polynomial which is basically PathCubic.
    I would be grateful if someone could tell me, where do I get coefficients from PathCubic ?

    Big thanks,
    Mateusz



  • Hi! There is no public interface other than that described in the manual: PathCubic QML Element.



  • Ok, so it's only to move control points with mouse but no way to know the function or get x/y values at any given point ?

    I found this https://doc-snapshots.qt.io/qt5-dev/qml-qtquick-pathinterpolator.html
    But unfortunately it's progress not x value this takes as an argument and even then fitting a cubic polynomial again just to get coefficients, would be wired.

    I hope they fix that...



  • Of course it takes a "progress" and not an x value; the curve is parameterized along its local normalized coordinate t. Also, tbh, I don't see what you want to get fixed there, it's f(t) -> (x, y). Just give the path interpolator said progress value and read its x and y properties.



  • I would like to get cubic polynomial coefficients of PathCubic, if possible. That would be really helpeful and usueful.


  • Qt Champions 2017

    @Mateusz said in Getting coefficients for PathCubic?:

    I would like to get cubic polynomial coefficients of PathCubic, if possible. That would be really helpeful and usueful.

    I think you're missing the point. The polynomial is given as a parametric curve f(t) = {x, y}, and not as the scalar function y = y(x), just as @Wieland wrote. So, no, you can't know what y corresponds to which x unless you know the exact way the curve was parametrized.



  • Ah right, its Beizer curve not simple polynomial.

    In my case I want to set control points both with mouse and with SpinBox to see exact values and let user to type exact values.

    Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.