posn in graphics/graphics

7 views
Skip to first unread message

Jos Koot

unread,
May 30, 2026, 1:44:58 PM (12 hours ago) May 30
to Racket-Users List
Hi
posn-s of graphics/graphics are structs with two reals. They are used to locate objects in a viewport. I would expect locations to be identified by two exact nonnegative integers pointing to a pixel. We don't have fractions of pixels, do we? Where  for example is (make-posn 3.4 5.6)? Does it identify the same position as (make-posn 3 6)? Maybe there is a reason posn has reals, but I do not see why. If there is such a reason, please tell me.

Racket is great!!!
Jos

George Neuner

unread,
May 30, 2026, 3:43:40 PM (10 hours ago) May 30
to Jos Koot, Racket-Users List

Hi Jos,

I don't think the coordinates are  /meant/  to be real valued ... I think somebody just used  real?  as the check function.  Or possibly the docs all are wrong: if you look at  racket/draw you'll see that all the functions specify coordinates as real values.   It certainly doesn't make any other sense.

Also, if you haven't already, you should ask in the discourse.

George
--
This group is deprecated and retained as an archive.
 
Racket discussions have moved to the Racket Discourse at https://racket.discourse.group/ .
Reply all
Reply to author
Forward
0 new messages