POV-Ray : Newsgroups : povray.general : How to find the maximum value of a function? : How to find the maximum value of a function? Server Time
30 Jul 2024 16:16:29 EDT (-0400)
  How to find the maximum value of a function?  
From: SharkD
Date: 14 Nov 2008 23:20:00
Message: <web.491e4dc3b6b31080cb91b1100@news.povray.org>
I have defined a function (function "fn_E", below) and would like to determine
a. the maximum possible value of the function, and b. the coordinates where the
maximum occurs. How can I accomplish this?

Thanks!

-Mike

#declare Blob_threshold = 0.2;
#declare Blob_start = 1;
#declare Blob_radius = 1;
#declare fn_A = function { pow(x+1,2) + pow(y,2) + pow(z,2) - pow(Blob_radius,2)
};
#declare fn_B = function { pow(x-1,2) + pow(y,2) + pow(z,2) - pow(Blob_radius,2)
};
#declare fn_C = function { Blob_start + Blob_threshold }
#declare fn_D = function { pow(Blob_threshold, fn_A(x,y,z)) +
pow(Blob_threshold, fn_B(x,y,z)) - fn_C(x,y,z) };
#declare fn_E = function { max(0,fn_D(x,y,z)) };


Post a reply to this message

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