Despite very limited mathematical operators, Evaluator Data Type Double is impressive

I just getting going on this.
Just for fun I'm working on an Evalulator Column that uses photo focal length and converts it to Field of of View. I need lens focal length in mm which is a keyword.

Happily, LXP's Exiftool columns give me FOV already for my ancient Minolta *..mrw files.
Using that info I was able to get some data as to the mathematics needed to get accuracy from focal length as I could guess with a simple calculation of the internal image size.

So, here's the thing.
Evalulator's Data Type Double is very forgiving about bad numerical computation thanks to the incredible precision that it has. Parentheses also work.

So, I need to compute an Arc Tangent.
I'm already getting 4 decimals accuracy in radians at 65.5 degrees.
Yeah it is stupid, but I'm learning and it is fun.
I have a long way to go.

theta = S/( f * 2 );
x = theta;
theta = theta - x*x*x/3;
theta = theta + x*x*x*x*x/5;
theta = theta - x*x*x*x*x*x*x/7;
theta = theta + x*x*x*x*x*x*x*x*x/9;
theta = theta - x*x*x*x*x*x*x*x*x*x*x/11;
theta = theta + x*x*x*x*x*x*x*x*x*x*x*x*x/13;
theta = theta - x*x*x*x*x*x*x*x*x*x*x*x*x*x*x/15;
theta = theta + x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x/17;
theta = theta - x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x/19;

theta = theta*2;
return theta
2 Likes

I'm still working on this just for fun, but I now realize that many cameras have Field of View and Depth of Field metadata. These are optically important to me at least.

I'm wondering what does Windows, or is it Directory Opus, use to sort a selected column.

I have made a little progress on my 'Hello World' Dopus Evalulator Column project.
Without any looping available in Evalulator, my fractions calculations needed and need rethinking.
This isn't the best way to do this !

But, with a little thought, I'm on my way.
Sadly, focal length metadata is normally only to one decimal.
So LXP's Exiftool Columns Field of View Metadata that I was able to extract never matched exactly to my calculated one. I was however able to make a good guess as to the camera internal image size.

I have it now to fractions of 10 * π radians.
I want to add fractions of 3 and 4 yet.
So here's the thing. I can't sort the column at all.
The filename column takes over any attempt at up and down sorting.
I'm wondering if I can get it to sort without making an Evaluator sorting Group.
I think it is dead, but I'd like to know why it used filename instead.

if (!IsSet(focallength)) { return; }
S = 9.25;
theta = S/(focallength * 2);
x = theta;
theta = theta - x*x*x/3;
theta = theta + x*x*x*x*x/5;
theta = theta - x*x*x*x*x*x*x/7;
theta = theta + x*x*x*x*x*x*x*x*x/9;
theta = theta - x*x*x*x*x*x*x*x*x*x*x/11;
theta = theta + x*x*x*x*x*x*x*x*x*x*x*x*x/13;
theta = theta - x*x*x*x*x*x*x*x*x*x*x*x*x*x*x/15;
theta = theta + x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x/17;
theta = theta - x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x/19;

theta = theta*2;
theta = theta/3.14159265359;
Denom = 10;
theta = theta * Denom;
Num = RegEx(theta, "(.*)\..*", "\1");
Frac = RegEx(theta, ".*\.([0-9]).*", "\1");
If (Frac >= 5 as int ) 
     {
	 Frac = 1 as int;
	 Num = Num as int + Frac;
	 }
test1 = Num as double /2 ;
test2 = RegEx(test1, ".*\.(.*)" , "\1");	 
If (test2 as int == 0) 
     { 
	 Num = Num as int /2 ;
     Denom = Denom as int /2 ;
	 }
//test3 = Num as double /5 ;
//test4 = RegEx(test3, ".*\.(.*)" , "\1");	 
//If (test4 as int == 0) 
//     { 
//	 Num = Num as int /5 ;
//     Denom = Denom as int /5 ;
//	 }	 	 
Num = Num + "/" + Denom + " π";
return Num;

Yep, it is just playing around yet.
Obviously division by 5 isn't needed and the variable have stupid names.

So here is the sort:
FovUp

FovDn