Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-02-2003, 07:23 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Vector Crash Course

Q: What is a vector?
A: A vector is a way of describing motion through space, regardless of the starting point of that motion.

Q: How do you write a vector? In physics, there are two useful ways. The first is polar coordinates. Polar coordinates tells you the magnitude and the direction of the vector. So you could say some vector, say v, is this.

v = r @ theta
For example:
v = 1.75 units @ 30 degrees (or pi/4 radians if you prefer)

However, this is not exactly useful when it comes to the calculations involved. Not, at least, given that most if not all of us are more familiar with Cartesian coordinates. In Cartisian coordinates, the vector tells information about the change in x and the change in y, usually called dx and dy, respectively.

v = <dx,dy>

Based upon the Pythagorean theorem, we can write polar coordinates in terms of Cartesian coordinates and vice-versa.

dx= r*cos(theta)
dy= r*sin(theta)

r^2=dx^2+dy^2
tan (theta)= dy/dx

So, from the earlier example of polar coordinates:

v = <1.299,.75> (roughly)

Next Post: Addition and multiplication of vectors
__________________


Help me keep scripting

Last edited by TribulationStaff; 09-02-2003 at 07:43 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.