Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed cubic-hermite eqn #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wkpark
Copy link

@wkpark wkpark commented Sep 7, 2023

fixed invalid cubic-hermite equations

import numpy as np

def plot(scale):
    # fake cubic hermite
    x = np.linspace(0, 1, 25)
    x2 = x*x
    x3 = x2 * x
    S = 100/24.
    y = (x3-2*x2+x)*S + (-2*x3+3*x2) + (x3-x2)*S # correct equation. You can get exactly the same result found at csv/*.tsv
    y = y * scale
    tmp = "FAKE_CUBIC_HERMITE   0," + ",".join(map(lambda x: str(int(x)) if x == int(x) else str(x), y))
    print(tmp)

    tmp = "FAKE_REVERSE_CUBIC_HERMITE   0," + ",".join(map(lambda x: str(int(x)) if x == int(x) else str(x), 1-y))
    print(tmp)

plot(1.0)

See also PR #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant