Python icon indicating copy to clipboard operation
Python copied to clipboard

enhancement

Open Ujwal200707 opened this issue 2 months ago • 2 comments

Feature description

in your bezier_curve.py in graphs you can add a feature like Currently, your BezierCurve class can evaluate the curve at any t, but it cannot compute the tangent direction or derivative of the curve — which is often useful for motion planning, animation, or drawing tools. def derivative(self, t: float) -> tuple[float, float]: This will compute the first derivative (tangent vector) of the Bézier curve at a given parameter t.

The derivative of an n-degree Bézier curve is another Bézier curve of degree n - 1:

def derivative(self, t: float) -> tuple[float, float]: This method computes the tangent vector (or slope) of your Bézier curve at a specific parameter value t, where t ranges from 0 to 1.

When t = 0, you get the tangent direction at the start of the curve.

When t = 1, you get the tangent direction at the end of the curve.

Intermediate values (like t = 0.25, t = 0.5, etc.) give the tangent at those points.

This is extremely useful when:

You want to know the direction of motion along the curve.

You want to compute velocity or acceleration in animations.

You want to draw tangent lines on the curve.

Ujwal200707 avatar Nov 04 '25 01:11 Ujwal200707

Hi! I’m interested in working on this issue.

nsree0507 avatar Nov 07 '25 06:11 nsree0507

thanks for your response

Ujwal200707 avatar Nov 07 '25 10:11 Ujwal200707