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

Home » Public Forums » archive » evenly spaced vector
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: evenly spaced vector [message #81327 is a reply to message #81182] Thu, 06 September 2012 12:41 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Thursday, September 6, 2012 1:23:51 PM UTC-4, sivan wrote:
> On Thursday, September 6, 2012 5:00:29 PM UTC+3, Craig Markwardt wrote:
>
>> On Thursday, September 6, 2012 7:22:21 AM UTC-4, sivan wrote:
>
>>
>
>>> On Sunday, September 2, 2012 11:46:56 PM UTC+3, Craig Markwardt wrote:
>
>>
>
>>
>
>>
>
>>> i appreciated for your reply.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> it doesn't matter whether I use arcsample or not.
>
>>
>
>>>
>
>>
>
>>> the problem is that i don't place evenly spaced points along the curve.
>
>>
>
>>>
>
>>
>
>>> modified or unmodified arcsample routine doesn't work as requested. i tried both.
>
>>
>
>>
>
>>
>
>> I tried this example:
>
>>
>
>> x0 = randomn(seed,5) & y0 = randomn(seed,5)
>
>>
>
>> arcsample, x0, y0, x, y
>
>>
>
>>
>
>>
>
>> plot, x0, y0 & oplot, x, y, psym=1
>
>>
>
>> plot, sqrt((x(1:*)-x)^2 + (y(1:*)-y)^2)
>
>>
>
>>
>
>>
>
>> It looks evenly spaced to me.
>
>>
>
>>
>
>>
>
>> The points are evenly spaced along the (spline interpolation) path, but that does not necessarily mean equally distant from each other (linear interpolation).
>
>>
>
>>
>
>>
>
>> ARCSAMPLE up-samples by a factor of 100. If you modify that to a larger and larger number, then neighbor points will tend to be more and more equidistant.
>
>>
>
>>
>
>>
>
>> CM
>
>
>
> this is the graphic:
>
> https://docs.google.com/open?id=0B8iEehZBld1OLUVXdndEQ2RwcE0
>
>
>
> as you can see, arcsample doesn't work properly. moreover, some points fall outside the curve.
>
>
>
> this is the code and the data:
>
> https://docs.google.com/open?id=0B8iEehZBld1OaEI5UkJiTVFkelk
>
>
>
> inform me if links are broken.

The points are equally spaced in path length, where path length between data values is defined by the pythagorean theorem. It's doing what you asked it to do. But the pythagorean theorem doesn't really make sense when X is tempoerature and Y is log_g, does it?

If you want equidistantly sampled points in *plot* space, then you need to transform to device coordinates first, then do your arcsampling.

Some warnings. ARCSAMPLE uses SPL_INTERP(), which has some overshoot for rapidly varying functions like yours. You may not want that. Also, you used David's original code which sets the endpoint slopes to AVGSLOPEX and AVGSLOPEY, but that assumes that it's still a closed curve. Yours is not a closed curve. For your open curves, you should revert to natural splines where the slope is not specified at the endpoints.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ArcGIS-like tool dialog box template
Next Topic: Re: Managing several object instances

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

Current Time: Sun Oct 12 04:58:38 PDT 2025

Total time taken to generate the page: 1.51702 seconds