Subject:
|
Re: Navigation & Encoders
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Wed, 5 May 1999 16:48:26 GMT
|
Original-From:
|
SHETTI.NITIN.MANGESH <SHETTIN@GIASBMC.VSNLnospam.NET.IN>
|
Viewed:
|
976 times
|
| |
| |
> I know this is not really handyboard specific but hey... Does anybody know
> the equation for finding a heading (theta) from a current position P(x,y) to
> a goal position G(x,y). I sure there's a tangent in there somewhere but
> I've already dredged up more trigonometry than I care to remember
> implementing these shaft encoders.
Dear Andrew,
You want the angle that line joining G and P make with X axis.
That is arctan of the slope of the line from P to G.
slope =(yP-yG)/(xP-xG)
hence, theta = arctan ((yP-yG)/(xP-xG))
where P=(xP,yP) and G=(xG,yG)
Note that this angle should be always measured wrt positive
direction of X axis.If slope of line is negative, the angle with positive
direction of X axis is obtuse. Add PI to -arctan of absolute value of the
slope.
I hope this helps.
Yours sincerely,
Nitin
|
|
Message is in Reply To:
| | Navigation & Encoders
|
| I know this is not really handyboard specific but hey... Does anybody know the equation for finding a heading (theta) from a current position P(x,y) to a goal position G(x,y). I sure there's a tangent in there somewhere but I've already dredged up (...) (25 years ago, 4-May-99, to lugnet.robotics.handyboard)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|