comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to calculate the abscissa values for the given vertical values
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to calculate the abscissa values for the given vertical values [message #68130 is a reply to message #68128] Mon, 05 October 2009 07:55 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Oct 5, 9:43 am, "dux...@gmail.com" <dux...@gmail.com> wrote:
> Maybe my statement is not clear.
>
> There is a function Y=F(X), and I want to calculate the correspondent
> abscissa values X for Y=0.
> It means that there are serval intersection points between the line Y=F
> (X) and the horizonal line Y=0,
> and I want to get the correspondent abscissa values of these points.

You should realize that what you *want* and what you can *achieve*
are two different things. This is a hard problem for general F...
I believe you should read chapter 9 (on root finding) of the
numerical recipes book.

But - this problem becomes more easy if you do know something about
the properties of your function - for instance if you can bracket
your solutions - so maybe the question is, what do you know about F?

Ciao,
Paolo

>
> On Oct 5, 3:10 pm, Wox <s...@nomail.com> wrote:
>
>> On Mon, 5 Oct 2009 01:56:20 -0700 (PDT), "dux...@gmail.com"
>
>> <dux...@gmail.com> wrote:
>>> Hi, all.
>>> I want to calculate the abscissa values for the given vertical values.
>
>>> For example,
>>>     x = findgen(1000)/1000*4*pi
>>>     y = cos(x)
>>> I want to get the abscissa values for y=0.
>>> For this example, the results shoule be [!pi/2, 3*!pi/2, 5*!pi/2, 7*!
>>> pi/2].
>>> But how can I get it by IDL codes?
>
>>> Best wishes,
>>> jdu
>
>> Just for this function:
>> print,(indgen(ceil(max(x)/!pi))+1)*!pi/2
>
>> What do you need exactly? You can always find the answer analytically
>> no?
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Earn Free cash From DoEarn
Next Topic: rois

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Dec 01 12:55:42 PST 2025

Total time taken to generate the page: 0.22289 seconds