4 Replies Latest reply on Oct 28, 2006 1:29 AM by 807607

# How to make an applet with a normal x and y axis?

I tried to get the screen height -1 and subtract from all the ys in my applet but it doesnt work all the time. I am drawing shapes and stuff with an algorithm I wrote for class.

is there a way to get origin(0,0) to the lower left screen easily.

thanks
• ###### 1. Re: How to make an applet with a normal x and y axis?
I tried to get the screen height -1 and subtract from
all the ys in my applet but it doesnt work all the
time. I am drawing shapes and stuff with an algorithm
I wrote for class.

is there a way to get origin(0,0) to the lower left
screen easily.

thanks
The only way I can think of would be write a method to convert a "normal" y coord to an applet y coord. That would probably end up being a huge pain in the ass, since you would have to pass all y coords through it before using them, so I suggest you just get used to y being upside down.
• ###### 2. Re: How to make an applet with a normal x and y axis?
Think of the coordinates as the 4th quadrant, just the y-values arent negative.
• ###### 3. Re: How to make an applet with a normal x and y axis?
it just annoying when I plot my points and try to scale, rotate and stuff. like say I have a point at 70, 180. If I rotate, 180 will be negative and thus off the screen. argh...
• ###### 4. Re: How to make an applet with a normal x and y axis?
well you know, coordinates are relative. The x and y coordinates are positive the way we think of it ( (0,0) being at the lower left) just because it's convention for the Mathematics world to do so. They're just part of a vector space and you can see it from any view point and be semantically equal.

Just need to get used to looking at it upside down for programming Java, is all, be simpler that way