Plot lines by rectilinear coordinates

jschuchert

Active Member
Licensed User
Longtime User
I want to be able to plot points and lines by coordinates. For example, a figure has rectilnear coordinates at a corner like 1234.23 N , 4567.123 E, etc. The user enters point numbers, each containing coordinates and the program draws the lines between them. I looked at the program designed by Klaus that is close to what I am after but his coordinates were within the confines of the actual screen pixels. How do I use my own coordinate system so that the lines will be accurate. I am used to numbers increasing as they go UP and to the right. Although they increase going right, they increase going DOWN with a PDA screen. I think I have done this before with another software but can't find it. This is not for CAD (beyond my small brain) but just a simple plot. Thank you for your help.

Jim Schuchert
 

klaus

Expert
Licensed User
Longtime User
Hi Jim,
What programs did you look at ?
If you have a look at the B4PPc Graphics Tutorial in the 'DrawOnScaleImage' chapter you have what you need. You can determine a bitmap with a given size and enter the coordinates of the upper left and the lower right corner.

You will need following variables and equations:
ScreenX0 = pixel coordinate of the left edge of the visible screen on the device
ScreenY0 = pixel coordinate of the upper edge of the visible screen on the device
ScreenW = width of the bitmap in pixels
ScreenH = heigth of the bitmap in pixels
xphysic0 = x coordinate of the upper left corner in physical coodinates
yphysic0 = y coordinate of the upper left corner in physical coodinates
xphysic1 = x coordinate of the lower right corner in physical coodinates
yphysic1 = y coordinate of the lower right corner in physical coodinates
ScaleX = (xphysic1-xphysic0)/ScreenW -> 1 pixel = ScaleX physical units
ScaleY = (yphysic1-yphysic0)/ScreenH -> 1 pixel = ScaleY physical units

Equations to transform x, y form pixels to phyiscal coordinates:
xphysic = (x - ScreenX0)*ScaleX + xphysic0
yphysic = (y - ScreenY0)*ScaleY + yphysic0

Equation to transform x, y physical coordinates to screen pixels
xpixel = (x - xphysic0)/ScaleX + ScreenX0
ypixel = (y - yphysic0)/ScaleY + ScreenY0

With this you can also have numbers inceasing UP, in this case ScaleY is negative instead of positive.

Hope this will help.

Best regards.
 

jschuchert

Active Member
Licensed User
Longtime User
Thank you very much, Klaus. I am sure I will find what I need here. The program I referred to was "snappointskalus".

Jim
 

jschuchert

Active Member
Licensed User
Longtime User
It was a reply to a post by 'dennisshea' in May,2008. You had the file zipped at the end of your post. I found it by typing 'drawing programs' in the search box. It is the second post down. Incidentally, if I knew how to attach a link from the forum I would have done it.

Jim
 

mjcoon

Well-Known Member
Licensed User
... Incidentally, if I knew how to attach a link from the forum I would have done it.

In each forum item at top right there's a link called "permalink". You can copy this (something like right-click and "Copy", depending on browser).

Then paste it into the new item, perhaps using the "globe/chain" icon called "Insert Link".

HTH, Mike.
 

jschuchert

Active Member
Licensed User
Longtime User
Thank you very much. Now there's something else I know. You guys are great.

Jim Schuchert
 
Top