I have problem which I want to draw a function graph with any input I key in.However I not familiar with the y-coordinate in java.I wish my graph got negative value !Does anyone know how to make it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default origin i.e. (0,0) for java 2d graphics is at the upper left corner of your screen.
To translate it to center of your screen use the following method of Graphics class
http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics.html
translate(int x, int y)
For eg.