Results 1 to 6 of 6

Thread: location in a circle

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86

    location in a circle

    I am writing a program to do single plane balancing using the vector method. I am trying to compare two locations in a circle. An initial and a trial location. What I need to do is, compare the relationship between the two and decide which way from the trial location is. If the initial location is at 90. 270 is 180 from it. And if the trial would fall on 260 it would be CW, 280 would be CCW. Which ever way the trial goes, it will never be more than 180 from the initial location. Is there an easy way to test the user inputs?

  2. #2
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    OK. Are you saying that, from a location on a circumferance of a circle, you're trying to find out how many degrees {the smallest number} you are from it? In comparison to another {test} point on the circumferance?

    -Lou

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    pretty much. The problem I am having is, when it goes past zero. If my initial reading is 100 and my trian is 355. It was a CCW move. But I cant figure out how to say it because it went to a number higher than 100. If that makes any sense. Both of these numbers can fall anywhere on the circumference, but they will never go more than 180 from the initial run. When I ad weight to my spindle ( lathe at work) and do a trial run, the balancer will only show a shift of 180 and stop. Telling me to add less weight. But the phase angle can go either way.

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Hmm, What was that called?
    ever hear of the law of cosines?
    Maybe that could help out?
    Although, I think that requires All three sides.

    Hmmm,
    2 points on a circle, from the origin, 2 sides of the triangle = R.
    But, you know X,Y of both points.

    Ahhh, Angles are additive.

    Using Sin = O/H, Cos = A/H, you CAN find the angle of each.
    Hmmm, Just have to figure if you add or sub.

    Let me think.
    Be back Tomorrow

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Consider the isosceles triangle initial-trial-center, the angle in the center being trialangle-initialangle and the base angle (trialangle-initialangle)/2
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    I am guessing that it wasnt really that complicated and was merely a numerical calc of numbers between 0 and 360 with a maximum difference of 180 clockwise or ccw. Anyways, it was also posted on general qtns here...

    http://www.vbforums.com/showthread.p...ighlight=angle

    Regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

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