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

Home » Public Forums » archive » Re: Beginner Question: PlotS rasterization info?
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: Beginner Question: PlotS rasterization info? [message #27806 is a reply to message #27800] Wed, 07 November 2001 09:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ted (sehgal@oasis.rad.upenn.edu) writes:

> When PlotS or Plot rasterizes straight lines between endpoints/vertices,
> what's the best way to get the coordinates of all the points
> interpolated? Surely this information is stored somewhere. Can I get
> these coordinates without actually plotting anything to the screen? I
> tried a Bresenham algorithm, but it doesn't return exactly the same
> interpolated points as PlotS--there appears to be some sort of roundoff
> difference. Any help would be appreciated, since currently I'm
> resorting to the roundabout and no doubt inefficient method of plotting
> to a pixmap, TVRD-ing, and then WHERE-ing the screen-dumped array....

Given the points (x1,y1) and (x2,y2), I think something like
this should work:

nPoints = ABS(x2-x1+1) > ABS(y2-y1+1)
xloc = x1 + (x2 - x1) * Findgen(nPoints) / (nPoints - 1)
yloc = y1 + (y2 - y1) * Findgen(nPoints) / (nPoints - 1)

You might have to ROUND the locations, but this should get
you pretty close, I think.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: PlotS rasterization info update
Next Topic: Re: IDL 5.5 help file

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

Current Time: Sun Oct 12 05:59:25 PDT 2025

Total time taken to generate the page: 0.48165 seconds