POV-Ray : Newsgroups : povray.bugreports : Bad values crash POV-Ray : Re: Bad values crash POV-Ray Server Time
25 Oct 2024 19:52:44 EDT (-0400)
  Re: Bad values crash POV-Ray  
From: kurtz le pirate
Date: 15 Oct 2024 09:57:49
Message: <670e74dd@news.povray.org>
On 14/10/2024 18:16, Bald Eagle wrote:
> I was experimenting with the mapping equations in:
> 
> https://archive.bridgesmathart.org/2018/bridges2018-59.pdf

Really interesting article...


> and crashed POV-Ray (3.8) about 6 times.
> 
> I'm guessing it has to do with trying to take square roots of something divided
> by 0, or 0/0.
> I haven't had a chance to scribble out a minimal .pov script to see what
> triggers it.
> 
> 
> 
> I also was not able to get the mapping to work correctly - I'm guessing that I'm
> going to have to apply the _inverse_ of the mapping - but I'm out of practice,
> and can't see an easy way to go about that.
> 
> Any suggestions?


I quickly did these two scenes.
I used the silly method that gives the images as attachments.
I don't know why you have crashes.

Here is some of my code :
-- begin code ---
#declare Sq = function(x) { x*x }

#declare fnDisc2Square = function(u,v) {
 
sgn(u*v)*sqrt(((-Sq(u)-Sq(v)+sqrt((Sq(u)+Sq(v))*(Sq(u)+Sq(v)+4*Sq(u)*Sq(v)*(Sq(u)+Sq(v)-2)))))/(2*(Sq(u)+Sq(v)-2)))
  }

#declare fnSquare2Disc = function(x,y) {
  sqrt((Sq(x)+Sq(y)-(2*Sq(x)*Sq(y)))/((Sq(x)+Sq(y))*(1-Sq(x)*Sq(y))))
  }

#macro Disc2Square(U,V)
  <fnDisc2Square(U,V)/V, fnDisc2Square(U,V)/U, -0.10>
#end

#macro Square2Disc(X,Y)
  <fnSquare2Disc(X,Y)*X, fnSquare2Disc(X,Y)*Y, -0.10>
#end
--- end code ---


Values between -1 and 1 go through zero, but I don't have any crashes.
I don't know if this will help you..


-- 
Kurtz le pirate
Compagnie de la banquise


Post a reply to this message


Attachments:
Download 'square2disc.png' (411 KB) Download 'disc2square.png' (440 KB)

Preview of image 'square2disc.png'
square2disc.png

Preview of image 'disc2square.png'
disc2square.png


 

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