Title: Dual numbers for creating distance estimators Post by: Syntopia on December 10, 2011, 11:58:45 AM I made a test using dual numbers to find the (length of the) gradient of the escape distance for the Mandelbox.
Pros: - The arbitrary epsilon (step distance) in the four-point Makin/Buddhi finite difference approach is avoided - which should give better numerical accuracy. It is also slightly faster computationally. Notice, most running scalar derivatives methods also use finite difference for finding the surface normal, which is not necessary using dual numbers. - Very general - e.g. works for non-conformal cases, where running scalar derivatives fail. Cons: - Slower than scalar estimators - Requires code changes (though there are nice libraries for languages supporting operator overloading) The way I did it was to construct three dual vectors (for x,y,z directions), and use the rules for dual arithmetics. This way the gradient is found, and the DE can be constructed using the length of the gradient: DE = r/dr. It seems to be a very similar to having a running Jacobian, but I haven't checked it in details. In fact, the whole concept of a running derivative seems to be similar to keeping track of a dual number together with the real number. Here is an image of a Mandelbox, where the scaling is done using different values for each axis - something which cannot be captured by a running scalar derivative: I'll put out a blog post with more details, when I get some time. Title: Re: Dual numbers for creating distance estimators Post by: Syntopia on December 14, 2011, 07:42:04 PM Here's a more complete description together with some sample code: http://blog.hvidtfeldts.net/index.php/2011/12/distance-estimated-3d-fractals-vii-dual-numbers/
Title: Re: Dual numbers for creating distance estimators Post by: eiffie on December 14, 2011, 08:19:02 PM Excellent blog by the way! |