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

Home » Public Forums » archive » Plotting lines between two polygons
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: Plotting lines between two polygons [message #12612 is a reply to message #12517] Mon, 24 August 1998 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
<snip>
>
> Can anybody tell me how to retrieve/compute the new
> coordinates for the line after a rotation/translation
> of the polygon?
>

Marco:

I'm not sure exactly what you're after, but here is a general
method for computing the new coordinates for the lines after
rotation and translation, for R2:

xcoors = [x1,x2,x3,...,xN] ; Vector of X coordinates for vertices
ycoors = [y1,y2,y3,...,yN] ; Vector of Y coordinates

p = fltarr(N,4)
p[*,0] = xcoors[*]
p[*,1] = ycoors[*]
p[*,3] = 1.0

save_pt = !p.t ; Compute matrix for affine transformations
t3d, /reset
t3d, rotate = [0.0, yrot, 0.0] ; Apply rotations
t3d, rotate = [xrot, 0.0, 0.0]
t3d, translate = [dx, dy, 0.0] ; Apply translation
t3d, scale = [scalex, scaley, 1.0] ; Apply scaling

p_new = p[*,*] # !p.t[*,*] ; Compute new coordinates
!p.t = save_pt

Hope this helps.

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
[Message index]
 
Read Message
Read Message
Previous Topic: Re: STRUCT_ASSIGN
Next Topic: Porting IDL

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

Current Time: Sun Oct 12 04:29:12 PDT 2025

Total time taken to generate the page: 0.88347 seconds