-- Continuous Geometric Means



Continuous Geometric Means

Definition of the Geometric Mean at:

http://en.wikipedia.org/wiki/Geometric_mean

The relationship with the arithmetic mean of logarithms at that page
can be used to derive an expression in case the medium is continuous:

GM = exp( integral(t=0..L) ln( f(t) ) dt / L )

We couldn't find many references on the Internet (Google) concerning
the _continuous_ version of the geometric mean. Curious about it ..

Example.

For a straight line segment, we substitute:

f(t) = (A.t - B)^2 + (C.t - D)^2 for 0 <= t <= 1 ;

Where A = x_2 - x_1 ; B = x - x_1 ; C = y_2 - y_1 ; D = y - y_1 ;

Meaning that f(t) is the squared distance between a point of the line
segment and a point (x,y) in the plane. Evaluate this a little bit:

f(t) = (A^2 + C^2) t^2 - 2.(A.B + C.D).t + (C^2 + D^2)

And make dimensionless: f(t) = t^2 - 2.a + b^2 .

Where: a = (A.B + C.D)/(A^2 + C^2) and b^2 = (C^2 + D^2)/(A^2 + C^2)

The discriminant of the quadratic f(t) turns out to be: a^2 - b^2 =

D = - (A.D - B.C)^2 / (A^2 + C^2) ; it is negative or zero. The case
D = 0 should be handled as a special case, where: f(t) = (t - a)^2 .

So we have to calculate:

E(x,y) = exp( integral(t=0..1) ln( t^2 - 2.a + b^2 ) dt )

A computer algebra system (MAPLE) has been employed for this purpose:

http://groups.google.nl/group/sci.math/browse_frm/thread/6540aee9c6a068ff

> collect(collect(int(ln(t^2-2*a*t+b^2),t=0..1,continuous),arctan),ln);

And the special case:

> collect(collect(int(ln((t-a)^2),t=0..1,continuous),arctan),ln);

The result has been programmed in Delphi Pascal. Here are some details:

var
A,B,C,D,N,I,S,E,F : double;
begin
A := two.x - one.x; C := two.y - one.y;
B := dit.x - one.x; D := dit.y - one.y;
N := sqr(A) + sqr(C); { assume nonzero }
S := (sqr(B) + sqr(D))/N; { b^2 }
I := (A*B + C*D)/N; { a }
D := sqr(A*D-B*C)/N; { discriminant }
E := 0;
if (D > 0) then
begin
D := sqrt(D);
F := (1-I)*ln(abs(1+S-2*I)) + I*ln(S)
- 2*D*(arctan((I-1)/D) - arctan(I/D)) - 2;
E := exp(F/2);
end;
if (D = 0) and (I <> 1) and (I <> 0) then
begin
F := ln(sqr(1-I)) - 2 - 2*I*(ln(abs(1-I)) - ln(abs(I)));
E := exp(F/2);
end;
if (D = 0) and ((I = 0) or (I = 1)) then E := exp(-1);
integraal := E;

And when visualized it looks as follows:

http://hdebruijn.soo.dto.tudelft.nl/jaar2008/segment.jpg

Similar attempt for a circle has resulted in the integral published at:

http://groups.google.nl/group/sci.math/browse_frm/thread/b1634000e5babd75

> exp(int(ln((a+cos(t))^2+(b+sin(t))^2),t=0..2*Pi)/(2*Pi));

It is suspected (Conjecture !) that the outcome is simply: (a^2 + b^2) .

Anyone to confirm or deny ?

Han de Bruijn

.



Relevant Pages

  • Re: Picking/object selection in directx
    ... One method I've used to trim down this task uses bounding spheres pre-calculated for each object, and tests them against the line segment under the cursor spanning the near clipping plane to the far clipping plane. ... At render time I've already done some coarse trimming to limit the rendering to likely visible objects, so already I've trimmed down the number of tests that may need performed. ... If it is less than or equal to the square of the bounding sphere radius, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Projecting segment with normals
    ... > also a plane. ... > Now I do a linear interpolation of the vectors and project every point on ... "point along the segment offset by an interpolated vector" in 3D. ...
    (comp.graphics.algorithms)
  • Re: an inequality from geometry
    ... the components of which is zero, ... with the plane H. ...
    (sci.math.research)
  • Re: Interpolating the Intersection of Surface & Plane
    ... have a line segment in my space that defines a portion of a plane ... that is parallel with the z-axis (the line segment above/below peaks ... Now this "plane segment" can cut through my peaks surface at any ...
    (comp.soft-sys.matlab)
  • Projecting segment with normals
    ... Let's say I have a segment with two normalized vectors at its ends. ... Now I do a linear interpolation of the vectors and project every point on ... the segment on the plane in the direction of the interpolated vector ... What curve will I get? ...
    (comp.graphics.algorithms)