How to have curve fits intersect at a given value?

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
TelemachusSneezed
Posts: 7
Joined: Fri Mar 30, 2007 11:57 pm

How to have curve fits intersect at a given value?

Post by TelemachusSneezed »

I was wondering if there is a way to use the "Polynomial Curve Fit..." function in such a way that it forces the fit to intersect at a certain value. In Excel, there is such an ability when one adds a trendline.

On a related note, it would be really cool to have the ability to add a tangent line to a curve at a certain point. It seems like such a feature would be easy (relative to a lot of other features :)) to add given that DPlot already has the "Differentiate a Curve..." feature.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I was wondering if there is a way to use the "Polynomial Curve Fit..." function in such a way that it forces the fit to intersect at a certain value. In Excel, there is such an ability when one adds a trendline.
No, not with that command. All of the coefficients are variables and cannot be set to fixed values (without quite a few changes to the code).

The More Curve Fits command will allow you to hold one or more coefficients at set values; that's still not exactly what you're looking for unless you're only interested in 1st order fits, though.

This is a good suggestion and I'll have to give this some thought. The only way to do this currently is to fake it by adding many additional data points all at the point you want the fit to go through, which weights the fit towards that point. "Many" is relative to how many points are in the original data. I'm not suggesting this as a good solution because it's quite a bit of trouble. But if you're in a hurry that should work.
On a related note, it would be really cool to have the ability to add a tangent line to a curve at a certain point.
I agree, it would be cool. This is related to another change I've had on my to-do list for a while but don't have in place yet: the ability to draw small slope triangles at specified points or between points with the X and Y components of the slope drawn on the sides of the triangle.
Visualize Your Data
support@dplot.com
Post Reply