How do I transform value into screen coordinates

AI Thread Summary
To transform x, y values into screen coordinates, a linear transformation is required. For the x-axis, where the range is from 0 to 800, the transformation can be expressed as h = Ax + B, with B determined to be 40. For the y-axis, which ranges from 12 to 20, the transformation is v = Ay + B, with A calculated from the difference between the screen coordinates at the top and bottom. By solving these equations, the appropriate values for A and B can be found to accurately map the coordinates onto the display area. This method ensures that the transformation maintains proportionality across the screen.
tonytj
Messages
1
Reaction score
0
How do I transform my x, y values into screen coordinates system

All values is in pixels
In my coordinate system origo is located in (40,495)
The display area that I can use is from X=40 to x=750 and
from y=495 to y=55
When you go down in the coordinate system the y value is increasing and when
you go to the right
the x value is increasing.
The y-axis is showing time from 12:00 to 20:00 and the x-axis is distance
showing from 0 to 800

So I can have values like
[13:10, 190]
[13:40, 240]
[14:25, 390]
[15:10, 431]
[16:10, 554]
[17:10, 643]
[18:10, 740]

I just wonder if someone has a algoritm that I can use to transform my
values into this coordinate system.


//Tony
 
Mathematics news on Phys.org
I assume you want a linear transformation (so that one part of the screen isn not "squeezed" or "stretched" more than another). You want x= 0 to correspond to screen coordinate, h= 40 and x= 800 to correspond to h= 750. A linear transformation is of the form h= Ax+ B. x=0, h= 40 tells you that 40= A(0)= B so B= 40. x= 800, h= 750 gives 750= 800A+ B= 800A+ 40. Solve that for A.

Similarly, in terms of "y" and vertical coordinates, you want v= Ay+ B. y= 12, at the bottom, corresponds to v= 495 so 495= 12A+ B. y= 20, at the top, corresponds to v= 55 so 55= 20A+ B. You can eliminate B from that by subtracting the two equations: 495- 55= 440= 8A. Solve that for A, the put that into either equation to solve for B.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Thread 'Imaginary Pythagoras'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top