Results 1 to 18 of 18
  1. #1
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Was: how to make a curve motion with ball object

    Quote Originally Posted by jim829 View Post
    A curve is nothing more than a series of x,y coordinates. So if f(x) is your curve equation then y = f(x) provides the two points.

    To start off simple, use y = mx + b for a straight line. By varying the sign and value of the slope (m) and the y intercept(b) you can draw a diagonal line. If you want to move the object from upper left corner to lower right corner of a square, use y = x, where the slope would be 45 degrees (or m = 1).

    Regards,
    Jim
    Correct me if i am wrong. He asked for curve right? I believe y=f(x) can never give you a curve.
    For a curve there will be 2 values of x for 1 value of y (or vice-versa).
    So you will need y=f(x).
    But again, since you get 2 values of x for each y, you will need logic to take negative/positive values first.

    eg: in this equation 4ay=x for parabola if we take a=4 and y=1, we will get +4 and -4 values for x..

    so if you give this directly in loop it wont wont. In loop, do the loop such that it iterate as follows:

    y=1, x=-2
    y=2, x=-1
    y=3, x=0
    y=2, x=1
    y=1, x=2

    It will help you understand more if you draw this in a graph and do some thinking..

    Hope this will help you.. :)
    Last edited by Kuttappu; 06-26-2013 at 05:59 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,302
    Rep Power
    20

    Default Re: how to make a curve motion with ball object

    Kuggappu, please limit yourself to subjects you understand. You clearly don't understand the mathematical significance of y = f(x).

    Also, there is no requirement that there be two values of x for 1 value of y (or vice-versa) in a curve. Nor does y = f(x) rule that out.

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

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,651
    Rep Power
    5

    Default Re: how to make a curve motion with ball object

    f(x) simply means a function of x, where x is the independent variable. So f(x) = x^2 +3x + 6 is an example. So f(2) = 16. However, in two dimensions the horizontal axis is x and the vertical axis is f(x) or y. This is algebra 101.

    Note: I did make one mistake. f(x) is a mathematical expression, not a mathematical equation. y = f(x) is an equation.

    Regards,
    Jim
    Last edited by jim829; 06-26-2013 at 08:12 PM.
    The Java Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  4. #4
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    Hi Darryl,
    Firstly, it is Kuttappu, not kuggappu.. Kuttappu is my name..

    I made a mistake that instead of writing 1st degree equation and second degree equation, i wrote y=f(x) and y=f(x)..

    Also, there is no requirement that there be two values of x for 1 value of y (or vice-versa) in a curve.
    1. Do you agree that for a curve we need a 2nd degree equation?

    FN:- ax+bxy+cy+dx+ey+f=0 is the general equation for conical section.

    You can derive equation of ellipse, hyperbola, parabola, etc from this. Whatever equation it is, if it is a curve it will be 2nd degree equation. Agree?

    2. Can you give a simple 2nd degree curve equation which does not have 2 values of x for 1 value of y (or vice-versa) ?
    Any equation of parabola, hyperbola or ellipse?
    How many solutions are there for a second degree equation (after you substitute for either x or y, when u l get a quadratic equation)?

    FN:-If you draw any line parallel to directrix or latex rectum, between vertex and infinity, it will touch "TWO" points in the curve. QED

    I believe only at vertex 2 solution of the equation are equal.

    Note:- All above are based on the assumption, that the curve is drawn in 2D. Also, i think exponential curves are exception to this (correct me if i am wrong).

    This may be a subject beyond my understanding, but i don't limit myself coz i am curious, please correct me again if i am wrong.. :)

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,651
    Rep Power
    5

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by Kuttappu View Post
    2. Can you give a simple 2nd degree curve equation which does not have 2 values of x for 1 value of y (or vice-versa) ?
    Any equation of parabola, hyperbola or ellipse?
    How many solutions are there for a second degree equation (after you substitute for either x or y, when u l get a quadratic equation)?
    But that is not the point. The issue was what it takes to generate a curve, not a parabola. Here is an example:

    Java Code:
    for (double x = 1; x < 10; x+= .1) {
        double y = x*x;
    }
    The coordinates generated will provide a curve. Just because y = x^2 is symmetric about the y-axis does not mean you need to use all of it to generate a curve.

    Regards,
    Jim
    Last edited by jim829; 06-27-2013 at 12:49 AM.
    The Java Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,302
    Rep Power
    20

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by Kuttappu View Post
    Hi Darryl,
    Firstly, it is Kuttappu, not kuggappu.. Kuttappu is my name..
    Sorry about that. My response was typed in a power cut, racing against the UPS battery going down and I shut down the computer as soon as I had posted it.

    Quote Originally Posted by Kuttappu View Post
    1. Do you agree that for a curve we need a 2nd degree equation?

    2. Can you give a simple 2nd degree curve equation which does not have 2 values of x for 1 value of y (or vice-versa) ?
    1. No.
    2. Exponential function - Wikipedia, the free encyclopedia

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

  7. #7
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by DarrylBurke View Post
    Quote Originally Posted by Kuttappu View Post
    Note:- All above are based on the assumption, that the curve is drawn in 2D. Also, i think exponential curves are exception to this (correct me if i am wrong).
    Except for exponential curves, any?.



    Quote Originally Posted by jim829 View Post
    But that is not the point. The issue was what it takes to generate a curve, not a parabola. Here is an example:

    Java Code:
    for (double x = 1; x < 10; x+= .1) {
        double y = x*x;
    }
    The coordinates generated will provide a curve. Just because y = x^2 is symmetric about the y-axis does not mean you need to use all of it to generate a curve.

    Regards,
    Jim
    Jim, you have taken one side (positive half) of parabola, right? Thats good, i like it.. :).
    what you have given is an equation of parabola. (y=x) Here is the image of the parabola:- https://www.google.co.in/search?q=y%...w=1366&bih=659

    Also, in that equation itself there are two values of x for 1 value of y (you wont know it since you looped x, you are taking positive half only).
    If you get the solution for it, then
    when y=1, x=-1 or +1
    when y=4, x=-2 or +2
    But that is mathematics.

    So can i conclude like,
    "There are two (or more) solutions for a curve equation (2nd degree or higher) (exponential curves are exception) in mathematics, but we put limits to get part of a curve in computer screen".

    So one last question..
    If i want a parabola, i will be needing two loops right? one as Jim said and another after that, with negative values of x. (Since computer screen is 1st quadrant we l take x as screen_x_axis+100 and y as screen_y_axis+100, or something like that? So we get a complete parabola?? )

    After all, to bounce a ball, you will need a parabola. :D

    Thank you Darryl and Jim. :).

  8. #8
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,563
    Blog Entries
    7
    Rep Power
    21

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by Kuttappu View Post
    So can i conclude like,
    "There are two (or more) solutions for a curve equation (2nd degree or higher) (exponential curves are exception) in mathematics, but we put limits to get part of a curve in computer screen".
    Every polynomial of degree 'n' (highest exponent value) has exactly n roots (possibly complex).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,651
    Rep Power
    5

    Default Re: how to make a curve motion with ball object

    I believe you are still missing the point. Here is what you said earlier:

    Correct me if i am wrong. He asked for curve right? I believe y=f(x) can never give you a curve.
    For a curve there will be 2 values of x for 1 value of y (or vice-versa).
    For a curve, you do not need two values of x for one value of y (or vice-versa). No one except you was talking about conic sections. The discussion was what it takes to make a curve.

    Regards,
    Jim
    The Java Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  10. #10
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by jim829 View Post
    I believe you are still missing the point. Here is what you said earlier:
    For a curve, you do not need two values of x for one value of y (or vice-versa). No one except you was talking about conic sections. The discussion was what it takes to make a curve.
    Regards,
    Jim
    The equation you gave in program is derived from general equation of conic section (ax+bxy+cy+dx+ey+f=0)
    y=x(the equation u gave in your program) is derived from equation of parabola (y=4ax or x=4ay) where a=1/4.
    You gave limits of x from 1 to 10, which takes only positive half of the parabola..

    (If u give the equation y=x to mathematician they will give 2 sets of values of x for every value of y. In you are program u r limiting to one half of parabola, right?).

    How can it not be part of conic section?

    Of course in a programmer point of view you dont need to know all mathematics, but just when you said no one is taking about conic section, you are actually using equation of conic section in your program. Am i wrong?

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,302
    Rep Power
    20

    Default Re: Was: how to make a curve motion with ball object

    Since the question asked in how to make a curve motion with ball object was answered in the first response, I've split this discussion to a new thread.

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

  12. #12
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by JosAH View Post
    Every polynomial of degree 'n' (highest exponent value) has exactly n roots (possibly complex).

    kind regards,

    Jos
    Yes, i agree.. Thats my point, so y=x also has two values for x if u substitute any value for y (except 0, when both solutions of x become 0).
    Thank you for framing in better words what i meant to say. :)

  13. #13
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    Posts deleted?

    So bad.. 1st time i am seeing someone say y*y=x is not conic section. Without mathematics there is no computer science.
    One guy asked for curve n you give equation of straight line?
    y=mx+b is for curve? good keep up the good work.

    Moderators, is this the way you do? I am quitting this forum. Please do a favor, delete my account details.

  14. #14
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,651
    Rep Power
    5

    Default Re: how to make a curve motion with ball object

    First, no one deleted anything. Darryl simply started a new thread since it was going off topic. No one has disputed that y = x*x is a conic section. And I am the one who suggested y = mx + b. The OP had said they could only go left, right, up, and down. So I suggested the OP try a diagonal first and then move to a curve. Why are you so angry?

    Regards,
    Jim
    The Java Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  15. #15
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,563
    Blog Entries
    7
    Rep Power
    21

    Default Re: how to make a curve motion with ball object

    Quote Originally Posted by Kuttappu View Post
    Posts deleted?

    So bad.. 1st time i am seeing someone say y*y=x is not conic section. Without mathematics there is no computer science.
    One guy asked for curve n you give equation of straight line?
    y=mx+b is for curve? good keep up the good work.

    Moderators, is this the way you do? I am quitting this forum. Please do a favor, delete my account details.
    This discussion was split in two sections; you'll find the other section (containing all your other posts) in the 'Form Lobby'. I was just reading this discussion while it was split ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  16. #16
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: how to make a curve motion with ball object

    Oh am sorry..

    It was a nice discussion, felt sad and angry when i saw all posts got deleted..

    Am sorry everyone..

  17. #17
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,302
    Rep Power
    20

    Default Re: Was: how to make a curve motion with ball object

    Moved the rest of the off topic posts here.

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

  18. #18
    Kuttappu's Avatar
    Kuttappu is offline Member
    Join Date
    Aug 2011
    Location
    Kerala, India
    Posts
    40
    Rep Power
    0

    Default Re: Was: how to make a curve motion with ball object

    Thank you Jim, Darryl and JasAh, nice discussion.

    :) see you.

Similar Threads

  1. how to make a curve motion with ball object
    By nisael in forum New To Java
    Replies: 3
    Last Post: 01-19-2014, 05:08 AM
  2. Make an object from a class once
    By OddOne in forum New To Java
    Replies: 7
    Last Post: 07-03-2012, 05:04 PM
  3. Freehand curve smoothing using Bezier Curve
    By JavaIsChallenging in forum Java 2D
    Replies: 3
    Last Post: 12-14-2011, 07:56 PM
  4. How do I make My ball to move randomly?
    By whdbstjr90 in forum New To Java
    Replies: 4
    Last Post: 12-31-2007, 05:32 PM
  5. Problem deleting ball from bouncing ball app
    By adlb1300 in forum New To Java
    Replies: 2
    Last Post: 12-03-2007, 09:08 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
  •