Csound Csound-dev Csound-tekno Search About

Re: airplane flange

Date1997-08-07 15:04
Fromjames@maths.ex.ac.uk
SubjectRe: airplane flange
owner-csound-outgoing wrote
>From owner-csound-outgoing Thu Aug  7 05:53:17 1997
From: owner-csound-outgoing
Date: Thu, 7 Aug 97 05:53:17 GMT
Message-Id: <22962.9708070553@maths.exeter.ac.uk>
To: owner-csound-outgoing
Subject: BOUNCE Csound: Non-member submission from [Eli Brandt ]

>From eli@gs160.sp.cs.cmu.edu Thu Aug  7 06:53:12 1997 remote from 
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Thu, 7 Aug 97 06:53:12 +0100
Received: from GS160.SP.CS.CMU.EDU [128.2.203.172] by hermes via SMTP (GAA04000); Thu, 7 Aug 1997 06:53:08 +0100
Message-Id: <199708070553.GAA04000@hermes>
Subject: Re: airplane flange
To: Csound mailing list 
Date: Thu, 7 Aug 1997 01:53:13 -0400 (EDT)
From: Eli Brandt 
In-Reply-To:  from "Hans Mikelson" at Jul 24, 97 03:25:24 pm
X-Portmanteau: pantryptaminergeticallysisterrainbowtie
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 1619      

Hans Mikelson wrote:
> For an ear at (0, Ye) and a plane at (Xp, Yp) and 
> angle-of-incidence=angle-of-reflection I get:
> 
> Direct-distance = sqrt(Xp^2 + (Yp-Ye)^2)
> Plane-to-ground = sqrt((YpXp/(Yp+Ye))^2 + Yp^2)
> Ground-to-ear   = sqrt((YeXp/(Yp+Ye))^2 + Ye^2)
> 
>                   P
>                  /|
>                 / |
>                /  |
>               /   | Yp
>              /    |
>        E    /     |
>     Ye |\  /      |
>        | \/       |
>         X1   X2
> 
> Note that Ye/X1 = Yp/X2 since angles are equal.  Xe=X1+X2
> 
> Solve for X1 & X2 in terms of Ye, Yp & Xe.  Then use the distance formula.

Yup.  The calculation is cleaner (no similar triangles) if you put an
imaginary ear underground:

                   P
                  /|
                 / |
                /  |
               /   | Yp
              /    |
        E    /     |
     Ye |\  /      |
       _|_\/_______|_
        | /
     Ye |/
        E'

The trouble is that the resulting formula involves subtracting two
approximately-equal large quantities, which means you're cancelling out
a number of bits of precision.  This is not actually a problem in my
application (it's all 8-byte floats); I just wondered how to make it
work with more limited precision.

But one second thought, a handwaving argument suggests that at 15km
(where the difference is about 0.5 meters (1.5 msec)) you only need
        log_2(15e3 / 0.5 * 100) + 1 [for sqrts]
     ~= 23 bits
e.g. 4-byte float for one-percent accuracy.  So maybe it's not a problem.

-- 
     Eli Brandt  |  eli+@cs.cmu.edu  |  http://www.cs.cmu.edu/~eli/


-- 
James Andrews, maths CDO, ext.3977