Re: calculations..

 BBS: Inland Empire Archive
Date: 01-08-93 (02:57)             Number: 337
From: HYLTON PEIMER                Refer#: NONE
  To: JOHN GALLAS                   Recvd: NO  
Subj: Re: calculations..             Conf: (2) Quik_Bas
 -=> Quoting John Gallas to All <=-

 JG> it still work if I wasn't using single precision (no decimals)?  Also,
 JG> lets say I'm at 500, 500 and my friends spaceship is at 600,650.  How
 JG> do I calculate what angle (in degrees, 0 to 359) I should face in
 JG> order to go visit him?

                           . me (600,650)
                    c  /  |
                     /    | yy
    you (500,500) ./______|

Simply, the above is a right angled triangle where xx=600-500
y=650-500. Just use Pythagoras to find c where c^2 = xx^2 + yy^2.
You can then use SIN or COS to find your angle. If you are given
radians then convert that to degrees.

... Press <Alt-A> to Adopt Me!  I need a better home.
--- Blue Wave/Max v2.01 [NR]
 * Origin: QuickSHARE's Australian HQ (03) 752-3949 (3:633/371.0)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET