|
-
Feb 18th, 2001, 09:42 PM
#1
I want to find the angle between 2 points. For
example, i am at point (1,2), and i want to be at (8,6).
First i need to rotate X degrees, until i face my
destination, then move N spaces, until i am there.
So, to make a right triangle, i take Point1.Y (2) and
Point2.X (8) to form the right angle at (8,2). Any
algorithm for this?
-
Feb 19th, 2001, 08:14 AM
#2
transcendental analytic
Check out my sample rotation using guv's safe arctangent function:
http://forums.vb-world.net/showthrea...threadid=53924
If you want to rotate 90 degrees you switch dx and dy as follows:
to the left
x = cx + dy
y = cy - dx
to the right
x = cx - dy
y = cy + dx
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.
-
Feb 19th, 2001, 11:47 AM
#3
I figured it out last night, but thanks kedaman. =)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|