Results 1 to 6 of 6
  1. #1
    Zie_Mordecai is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Creating 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.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: 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
    Last edited by DarrylBurke; 01-16-2013 at 08:04 AM.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: Creating a Mathematical Curve in Java

    Quote Originally Posted by Zie_Mordecai View Post
    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.
    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
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Zie_Mordecai is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Re: 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.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: Creating a Mathematical Curve in Java

    Please go through Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: 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
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Freehand curve smoothing using Bezier Curve
    By JavaIsChallenging in forum Java 2D
    Replies: 3
    Last Post: 12-14-2011, 07:56 PM
  2. Java Learning Curve
    By mwildam in forum New To Java
    Replies: 13
    Last Post: 10-17-2008, 11:09 AM
  3. Help with mathematical part in java
    By lenny in forum Advanced Java
    Replies: 3
    Last Post: 08-09-2007, 01:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •