Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Conic section.

Status
Not open for further replies.

vlad777

Member
**broken link removed**

Hello.
This is a little program that I made.
I am using this formula:
y^2=a*x^2+b*x+c+d*x*y+e*y
and Gauss-Jordan to find coefficients.
Then I use:
y^2+(-d*x-e)*y+(-a*x^2-b*x-c)=0
to draw to screen.

Tell me what you think and if it works on your machine.
Next I am thinking to do this with cubic formula
with 10 coefficients/points.

Cheers.
 
Hi,

Nice Vlad :)

I'd like to hear more about how you went about doing this, and what else you might have had to do to draw to screen. For example, did you plot x,y parametrically or did you solve for y?
 
I solved for y, and if d>0 i plot two y's and if d<0 i don't plot.
(d=b^2-4*a*c)

I made a "solve" function that takes two matrices (one square and one vector) and does Gauss-Jordan, but currently
it does not do row exchange so singular matix would give infinite values.


Edit:
The point was not to draw ellipse because there are simpler and faster ways,
but to experiment what problems I can solve with equation with terms with coefficients.
For example if I have system of two equations I can map a texture.
 
Last edited:
Hello again,


By the looks of your second image there it seems that you might be happy if you looked into another method which is basically curve fitting using the least sum of squares method.
See if you can find something on this on the web, i think you'll find it interesting and you can do a program for it too.
 
Last edited:
If you mean "least squares" , I have that in mind but that is regression and this is interpolation.
The difference is that you use lower degree polynomial and before Gauss-Jordan you first project y vector to column space.
 
Hi,

Call it regression or interpolation but it's mostly the same. Or so your second picture shows, where you need to find points between other points given just a few points or a whole set of points. That's curve fitting in general.

With the least squares method you'll find that the curve through the points fits nicer given a set of points like you show in your graph. Instead of a wildly changing curve you get a much nicer 'fit' and that's a better interpolation at the same time.

Try it with your set of points in your second graph, and then you can also choose the order of the polynomial that you think would represent the fit to a good enough degree to meet the requirements of the application.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top