Skip to content

Fix second derivative when using Halleys method for iteration by length#55

Merged
stribor14 merged 2 commits intomasterfrom
mirko-iterateBL-fix
Aug 19, 2025
Merged

Fix second derivative when using Halleys method for iteration by length#55
stribor14 merged 2 commits intomasterfrom
mirko-iterateBL-fix

Conversation

@stribor14
Copy link
Copy Markdown
Collaborator

No description provided.

@stribor14 stribor14 requested review from Copilot and tiborbs1 August 19, 2025 09:08
@stribor14 stribor14 self-assigned this Aug 19, 2025

This comment was marked as outdated.

@stribor14 stribor14 force-pushed the mirko-iterateBL-fix branch from c5a1241 to 8cab27b Compare August 19, 2025 09:11
@stribor14 stribor14 requested a review from Copilot August 19, 2025 09:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the calculation of the second derivative in Halley's method for iterating by arc length. The fix corrects how the second derivative is computed when using the chain rule to differentiate the arc length function.

  • Corrected the second derivative calculation from derivativeAt(2, t).norm() to dC.dot(dC2) / df
  • Improved code clarity by using a struct instead of std::pair and renaming variables for better readability
  • Updated parameter name from s to ds to better reflect it represents a distance offset

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/bezier.cpp Fixed second derivative calculation in Halley's method and improved variable naming
include/Bezier/bezier.h Updated function signature to match implementation parameter name change

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@stribor14 stribor14 requested a review from tiborbs1 August 19, 2025 09:43
Copy link
Copy Markdown
Contributor

@tiborbs1 tiborbs1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@stribor14 stribor14 merged commit e4b0c58 into master Aug 19, 2025
1 check passed
@stribor14 stribor14 deleted the mirko-iterateBL-fix branch October 1, 2025 08:45
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.

3 participants