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

Home » Public Forums » archive » good way to subdivide line segments?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
good way to subdivide line segments? [message #40012] Wed, 07 July 2004 07:13 Go to next message
boncat41 is currently offline  boncat41
Messages: 2
Registered: June 2004
Junior Member
right now i have sensor plates defined by 6 pts connected by line segments
(7 pts, so it closes on itself--rectangle). what i'd like to do is
'segmetize' the line segments to get a better resolution and to simplify
future calculations. any ideas? Thanks in advance.

cat
Re: good way to subdivide line segments? [message #40082 is a reply to message #40012] Fri, 09 July 2004 06:55 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
boncat41 wrote:
> right now i have sensor plates defined by 6 pts connected by line segments
> (7 pts, so it closes on itself--rectangle). what i'd like to do is
> 'segmetize' the line segments to get a better resolution and to simplify
> future calculations. any ideas? Thanks in advance.

Hi,

I think you mean subdividing each line into smaller line segments. Any
straight line can be subdivided by using a trick that David Fanning
describes for interpolating along an image profile.

http://www.dfanning.com/ip_tips/image_profile.html


The following starts with just 2 points and finds interpolates between
the pair.

Ben

x = [8.0, 10.0]
y = [3.0, 15.0]

Plot, x,y, psym = -6

;y = a + bx
b = (y[1] - y[0]) / (x[1] - x[0])
a = (y[0]) - (b * x[0])

print, 'a = ', a
print, 'b = ', b

nInterps = 4
xx = (FindGen(nInterps)/(nInterps-1) * (x[1]-x[0]) )+ x[0]
yy = a + b * xx

oPlot, xx, yy, psym = 4, symsize = 2
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Best method for very big array rebinning?
Next Topic: Re: Random convolution ?

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

Current Time: Fri Oct 10 01:18:06 PDT 2025

Total time taken to generate the page: 0.40003 seconds