vicrucann / curvefitting Goto Github PK
View Code? Open in Web Editor NEW:wavy_dash: Curve fitting based on Schneider's algorithm. Written using C++11 and OpenSceneGraph (visualization)
License: MIT License
:wavy_dash: Curve fitting based on Schneider's algorithm. Written using C++11 and OpenSceneGraph (visualization)
License: MIT License
This is James Phillips, author of the Python language pyeq3 curve fitting library on GitHub at https://github.com/zunzun/pyeq3. I include in my code's unit tests a test of exponential sensitivity that you might be interested in, the equation to be fitted is
y = a * exp(bx) + Offset
and the data for the test is
x y
0.9 -2997.81165143259
1.5 -2997.67633151454
13.8 -2992.05019674501
19.8 -2985.51451402968
24.1 -2977.73207770987
28.2 -2966.44629865572
35.2 -2932.4311430723
60.3 -2168.56994123603
74.6 474.296114697706
81.3 3789.59913028271
Fitted coefficients should be
a = 2.0
b = 0.1
Offset = -3000.0
The test is quite sensitive. My nonlinear fitter uses the Differential Evolution genetic algorithm to determine initial parameters for the Levenberg-Marquardt nonlinear fitter in scipy's Python fitter.
James
I realize this repo has been untouched for many years and I don't know if PRs are welcome but I think this is a small bug with an easy fix. In the function generateBezier()
, two Point2
variables are instantiated with their default constructor. The following block of code may or may not modify them. Then they are tested for "NaN-ness" with isNaN()
. If the Point2
's default constructor does not initialize the point's coordinates with NAN
, I believe this test will sometimes fail when it should succeed.
It's my understanding that the code expects Point2
to default initialize to NaN
when that may not always be the case. It is indeed not the case for osg::Vec3f
which default initializes to all 0
.
Easy fix. This line:
Point2 handle1, handle2;
should be:
Point2 handle1 = this->getNANPoint(), handle2 = this->getNANPoint();
I've observed the effect of this bug with a sawtooth path and the first two segments of the resulting curve had control points P1
and P2
equal to P0
and P3
respectively.
That second screenshot is also what one can observe with paper.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.