

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.
Post a reply to this message




"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)
https://mathforcollege.com/nm/mws/gen/09opt/mws_gen_opt_txt_newopt.pdf
http://mathforcollege.com/nm/mws/gen/03nle/mws_gen_nle_txt_newton.pdf
http://www.lendek.net/teaching/opt_en/numerical%20optimization.pdf
https://relate.cs.illinois.edu/course/cs357f15/fileversion/03473f64afb954c74c02e8988f518de3eddf49a4/media/cs357slide
snewton2.pdf
https://en.wikipedia.org/wiki/Maxima_and_minima
https://en.wikipedia.org/wiki/Goldensection_search

Tor Olav
http://subcube.com
https://github.com/tok
Post a reply to this message

