Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #11436

Re: Topography contours

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.programming
Subject Re: Topography contours
Date 2020-11-12 17:44 +0000
Organization A noiseless patient Spider
Message-ID <871rgyqxkx.fsf@bsb.me.uk> (permalink)
References <599350c8-0ae4-44eb-8a55-f533be181cc0n@googlegroups.com> <87eekyr2jt.fsf@bsb.me.uk> <6a8b566d-18cf-4ef7-bb1f-4ae41b9ecd8bn@googlegroups.com>

Show all headers | View raw


Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Thursday, 12 November 2020 at 15:57:15 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> 
>> > If you have a topology in continuous space that you can sample to 
>> > arbitrary resolution, both in space and in height, what is the best 
>> > way of producing isomers (contour lines of equal height).
>> I've never heard of the called that before. If you are searching, I 
>> think contour lines will be more successful 
>> 
>> There must be established algorithm for this and if you find one, please 
>> post a link. 
>> 
>> If you can assume your function is continuous and smooth, I thought you 
>> could use partial derivatives to find the tangent of the contour at a 
>> given point. You could the move some small step in that direction and 
>> try again. But to stop errors piling up, you'd have to a search in the 
>> neighbourhood of the end point for a close match to the starting value. 
>> 
>> Given that, maybe just a search at each step is the best bet. If the 
>> function is smooth in relation to the step size you want to take, you 
>> might get away with a binary search of the points on a circle of radius 
>> r (the step size) away from the previous point, with the angles ranging 
>> from -pi to +pi and 0 being "ahead" -- the direction of the last line 
>> segment in the contour. (It would be easier to describe with a 
>> diagram!) 
>> 
>> And you could, of course, make the step size dependent on how smooth 
>> the function is in an particular neighbourhood. 
>> 
> The function is continuous and smooth, and basically well-behaved (no
> sharp spikes or well-like depressions). I can also obtain rough limits
> for maximum / minimum. However the contour lines (isomer is the wrong
> word, sorry about that) have to be described in vector to a good accuracy.
>
> I also need to obtain them interactively, so ideally under 1/10th of a second
> though up to about 10 seconds is tolerable.

Is the function itself slow to calculate?  How many points do you think
will be needed for good accuracy?

> A circular search followed by a step is worth trying.

If the function is smooth enough, a binary search of the circle should
work and not be too slow.  Since for most of the contour the next step
will be in pretty much the same direction as the last, you don't need to
cut the search angles into equal parts.  I don't know of the speed-up
would be worth it, but it's something I'd try just for fun.

-- 
Ben.

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Topography contours Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-11-11 09:26 -0800
  Re: Topography contours Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-11-12 15:57 +0000
    Re: Topography contours Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-11-12 08:24 -0800
      Re: Topography contours Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-11-12 17:44 +0000
        Re: Topography contours Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-11-13 05:22 -0800

csiph-web