Hey I am having a problem of creating a Mathematical Curve that fits the sin(2x) or cos(2x) on a x and y axis regardless if it was negative or positive value. If it is possible or feasible may somebody help me out, I would deeply appreciate it.

Printable View

- 01-16-2013, 07:34 AMZie_MordecaiCreating a Mathematical Curve in Java
Hey I am having a problem of creating a Mathematical Curve that fits the sin(2x) or cos(2x) on a x and y axis regardless if it was negative or positive value. If it is possible or feasible may somebody help me out, I would deeply appreciate it.

- 01-16-2013, 08:00 AMDarrylBurkeRe: Creating a Mathematical Curve in Java
Please go through the Forum Rules, particularly the second paragraph. I've merged the thread you started in New to Java here.

db - 01-16-2013, 08:04 AMDarrylBurkeRe: Creating a Mathematical Curve in Java
To get help, you need to show what you've tried and explain how it doesn't meet your need, then ask a specific question. As it stands, this post looks like 'here's my assignment, someone please do it for me' -- and that isn't going to happen.

Are you familiar with the java.lang.Math class? Do you know how to perform custom painting? Have you read up about 2D Graphics?

db - 01-16-2013, 08:16 AMZie_MordecaiRe: Creating a Mathematical Curve in Java
I have a book called JAVA 2D Graphics by Jonathan Knudsen. I can create the frames, however making the x and y axis is somewhat misleading. Here is what I did,

public static void main(String[] args) {

JFrame f = new JFrame();

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.add(new GraphingData());

f.setSize(400,400);

f.setLocation(200,200);

f.setVisible(true);

}

protected void paintComponent(Graphics g) {

super.paintComponent(g);

Graphics2D g2 = (Graphics2D)g;

}

That's how far I got.

Can you help me out please. - 01-16-2013, 09:08 AMDarrylBurkeRe: Creating a Mathematical Curve in Java
Please go through http://www.java-forums.org/forum-gui...w-members.html and BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.

db - 01-16-2013, 09:11 AMDarrylBurkeRe: Creating a Mathematical Curve in Java
Also, you didn't reply to my 3 simple questions and it's clear that you haven't gone through the painting tutorial. If you're not going to take advice, why ask for it?

db