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

Add derivative and curvature to PathSeg #197

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sh4rK
Copy link
Contributor

@Sh4rK Sh4rK commented Sep 14, 2021

This is meant to start thinking, rather than as a finished PR.

The goal is to allow PathSegs to be differentiated, as it can be useful in some cases to treat all kinds of paths uniformly.

This PR implements two possible solutions, but there are more I can think of:

  1. Derivative of a line is a degenerate line (in this PR)
    Pros:

    • easy to implement without many changes

    Cons:

    • is basically a hack
  2. Add ConstantPoint to PathSeg
    Pros:

    • PathSeg will be closed regarding to differentiation
    • smallish change

    Cons:

    • ConstantPoint doesn't really make sense in PathSeg
  3. Add a deriv_at method (better name welcome) to PathSeg (in this PR)
    Pros:

    • small change

    Cons:

    • limited to the evaluation of the first derivative
    • odd to have it only on PathSeg
  4. Add a new trait that allows evaluating the first (second?, third?) derivative
    Pros:

    • more general solution than above

    Cons:

    • limited to the evaluation of the first (second?, third?) derivative

Any thoughts, more ideas? Is something like this even welcome? :)

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.

1 participant