POV-Ray : Newsgroups : povray.programming : "linked" value functions : Re: "linked" value functions Server Time
4 Jul 2022 08:41:31 EDT (-0400)
  Re: "linked" value functions  
From: Tor Olav Kristensen
Date: 23 Apr 2020 15:10:01
Message: <web.5ea1e6b4d21148b676d1a4ea0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> So, I've come across this a few times, and I'm not sure if this is a "usual"
> operation or a formal function/macro in certain languages.
> I want to compare two values, but I want to then utilize a third, linked value.
> So in the current situation, I'm looking at the dimensions of vectors during a
> rotation, and a typical operation is to do something like:
> #local MaxX = max(TestValue, MaxX);
> But I don't want to keep track of the magnitude of maximum vector - I want to
> keep track of the ANGLE of rotation at which that maximum occurs.
> Obviously I can concoct some sort of macro to handle this, but it just seemed to
> me that this must be a somewhat common task, to the point where such a function
> might exist and have a name.

Hi Bill

If the value for each component is a function of an angle - and you know this
function, then it may be that you can find the extreme points analytically.

If you don't know this function, then here's some terms to search for and some
relevant links.

golden section search
Fibonacci search
Newton Raphson optimization
optimization in one dimension
numerical optimization
numerical analysis extremum (or extremes)


Tor Olav

Post a reply to this message

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