POV-Ray : Newsgroups : povray.general : Equations of conic sections passing through user-specified points Server Time
27 Jul 2024 12:40:09 EDT (-0400)
  Equations of conic sections passing through user-specified points (Message 1 to 2 of 2)  
From: Bald Eagle
Subject: Equations of conic sections passing through user-specified points
Date: 9 Jul 2024 10:55:00
Message: <web.668d4f1bbfdcfcebc103d2725979125@news.povray.org>
This is a topic that has come up before, and a recent request made me think that
we ought to have a collection of macros that handle most of the typical cases
that arrive when needing to arrange things along a given curve.

"Axis - aligned" curves in the standard orientation are fairly straightforward
to derive an equation, but rotated forms are quite a bit more challenging.

I'm posting this link as an excellent reference, and hoping that there will be
more resources and macros written to address this sort of need in the future.

https://www.anirdesh.com/math/algebra/parabola-rotation.php

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Equations of conic sections passing through user-specified points
Date: 13 Jul 2024 16:10:00
Message: <web.6692de0293217bca1f9dae3025979125@news.povray.org>
So here's a simple scene file that, given 3 points, solves the equation of the
parabola that passes through them all, and graphs the curve.
Steps to the solution are in the #debug stream.

I'm kind of laughing, because not that long ago, I posted a request to consider
having functions like lcm and gcd in POV-Ray's inbuilt math library.
Then I wrote a macro to compute both.
And yet before that, jr wrote a macro to compute gcd - wondering of what use it
would be.

So here is a good example of a situation where it gets used to "match"
coefficients to eliminate variables.

I'm sure there are many ways to do this, and Gauss-Jordan elimination using a
matrix would be another way.

I have been super busy as of late, and it's pretty hot and humid - so I'm just
posting my terribly written code so that it's available for perusal.

So I have code to solve for circles, parabolas, very quick crude code for a
hyperbola, and now I just need some code for an ellipse.

Once the basics are in place, further levels of functionality and sophistication
can be added.

Enjoy,

- BE


Post a reply to this message


Attachments:
Download 'parabola.pov.txt' (7 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.