Results 1 to 7 of 7

Thread: parametric

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283

    parametric

    how do i find out if a parametric function is turning left or right?
    test your algorithm on these functions:

    t goes from 0->360 degrees or 0->2pi radians
    x=sin(t)
    y=cos(t)
    should always turn right.


    t goes from 0->360 degrees or 0->2pi radians
    x=sin(t)
    y=cos(2t)
    turns right from t=0 to t=pi
    turns left from t=pi to t=2pi

    thanks.

    -marvin

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Theoretically, you could find the tangent line of the point immediately before the point you want to test and plug in the poing you want to test into that (made into an inequality) to test whether it is going straight, left, or right. This could most likely be made to work on a function, but I don't feel like it right now
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3
    Lively Member
    Join Date
    Oct 2003
    Location
    Guildford, UK
    Posts
    91
    The property of a curve which *could* tell you whether it's turning left or right is called its curvature:

    Cartesian:

    K = d2y/dx2 / (1 + (dy/dx)2)^3/2

    Parametric:

    K = (x.y.. - y.x..) / (x.2 + y.2)^3/2

    Intrinsic:

    K = d(psi)/ds

    At a given point on the curve, if K is positive the curve is turning left, and if K is negative the curve is turning right. I'm not sure if this is always the case but it probably is.

  4. #4

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283
    Originally posted by TheManWhoCan

    K = (x.y.. - y.x..) / (x.2 + y.2)^3/2

    can you explain your syntax? what is " x.y..-y.x.. "???

  5. #5
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    I'd assume he means 'x.' is the first derivative of x, and 'x..' is the second derivative of x.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  6. #6
    Lively Member
    Join Date
    Oct 2003
    Location
    Guildford, UK
    Posts
    91
    Yeah:

    x. = "x-dot" = dx/dt
    x.. = "x-double-dot" = d2x/dt2

  7. #7

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283
    thanks for the help-

Posting Permissions

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



Click Here to Expand Forum to Full Width