Path: utzoo!attcan!uunet!samsung!sol.ctr.columbia.edu!lll-winken!unixhub!shelby!msi.umn.edu!cs.umn.edu!quest!viper!dave From: dave@viper.Lynx.MN.Org (David Messer) Newsgroups: comp.graphics Subject: Re: Stupid Beginner Question, but I am stuck! Message-ID: <4092@viper.Lynx.MN.Org> Date: 9 Nov 90 02:57:28 GMT References: <35558@cup.portal.com> Reply-To: dave@viper.Lynx.MN.Org (David Messer) Organization: Lynx Data Systems, Eagan, MN Lines: 18 In article <35558@cup.portal.com> Bobster@cup.portal.com (Robert Jules Shaughnessy) writes: > > I am having troubles finding the angle from one point on a 2D plane to >another. For instance at point A, what direction would I need to go to hit >point B, in degrees. > I do have something that works, I take the ATN of x1-x2/y1-y2 and this >works ok, but will only show 90 degrees. There is a function in the standard C library called atan2() that handles this (call as "angle = atan2( x1-x2, y1-y2 )" ). If you don't have the standard C functions, writing this shouldn't be particularly difficult. The CRC Standard Math Tables book is a good place to start for information on formulas. -- How can you tell if Bush is lying? | David Messer dave@Lynx.MN.Org -or- Watch his lips... | Lynx Data Systems ...!bungia!viper!dave