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

Home » Public Forums » archive » Re: A distracting puzzle
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: A distracting puzzle [message #26683] Wed, 19 September 2001 06:28 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Martin Downing wrote:
>
> Hi JD,
>
> Since you are interested in high resolution, the relationship between pixels
> and points is of interest.
> I.e.: where in pixel (i,j) is point P(x=i, y=j)? Do you consider the pixel
> to be centered on the point P(i,j) or P(i+0.5,j+0.5)?
>
> Martin

This choice is somewhat arbitrary, but my convention has always been the
latter: pixels centered at the 1/2 pixel. E.g. pixel [0,0] has center
[0.5,0.5], and its lower left edge corresponds to [0.0,0.0]:

[0.0,1.0] [1.0,1.0]
+-------------+
| |
| [0.5,0.5] |
| + |
| |
| |
+-------------+
[0.0,0.0] [1.0,0.0]


In case anyone is actually trying this for real, the correct answers for
the 10x10 array and the default polygon given are (using my horribly
slow algorithm):

+============+
| Pix Frac |
+============+
| 11 0.3295 |
| 12 0.1284 |
| 21 0.3765 |
| 22 0.9866 |
| 23 0.4890 |
| 31 0.0567 |
| 32 0.9669 |
| 33 1.0000 |
| 34 0.5000 |
| 42 0.6706 |
| 43 1.0000 |
| 44 0.9006 |
| 45 0.0861 |
| 52 0.3176 |
| 53 0.8559 |
| 54 0.1299 |
| 62 0.0282 |
| 63 0.0876 |
+============+

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Object Graphics --> EPS Output how?
Next Topic: Text Widget Confession

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

Current Time: Wed Oct 08 17:03:20 PDT 2025

Total time taken to generate the page: 0.00518 seconds