Hey guys I have a 500x500 grid that I am using to act as a graphing calculator. I have got my points plotted and the line is right the only problem is that my line is starting from the top left corner of the graph and not the middle of the x and y axis? Any ideas of how I could shift it to the middle of the grid and flip it across the y axis?
Shifting Grid
Page 1 of 12 Replies - 126 Views - Last Post: 04 October 2012 - 08:30 PM
Replies To: Shifting Grid
#2
Re: Shifting Grid
Posted 04 October 2012 - 08:14 PM
You are preaching in the desert
Are you in a GUI environment ?
Grid of which type of Object ?
points ? Graphic points ? Java awt.Point ?
letf top corner of the graph ... Graph ? What is a graph ? JPanel ? Canvas ? JFrame ? ...
x and y axis ? Which type of coordinates ?
...
We cannot guess your environment, that is why we ask to post code when possible
Are you in a GUI environment ?
Grid of which type of Object ?
points ? Graphic points ? Java awt.Point ?
letf top corner of the graph ... Graph ? What is a graph ? JPanel ? Canvas ? JFrame ? ...
x and y axis ? Which type of coordinates ?
...
We cannot guess your environment, that is why we ask to post code when possible
#3
Re: Shifting Grid
Posted 04 October 2012 - 08:30 PM
pbl is correct in that we don't have much to go on.
If I assume you're drawing to a JPanel, I'd tell you but Java's Graphics matrix plots 0,0 as the top left, and you could change that with the AffineTransform class translate() method.
If I assume you're drawing to a JPanel, I'd tell you but Java's Graphics matrix plots 0,0 as the top left, and you could change that with the AffineTransform class translate() method.
This post has been edited by farrell2k: 04 October 2012 - 08:30 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|