![]() |
|
#1
|
|||
|
|||
finding angle between 2 vectorhi...juz wanna ask whether any one of you knows how to calculate angle from 2 given vectors? my vectors are in the 3rd dimension (1,2,3) <-- something like this.
i got these codes...not sure whether it's correct. can you guys chk for me? CPP / C++ / C Code:
|
|
#2
|
|||
|
|||
|
oh yes what is CVector3?
|
|
#3
|
|||
|
|||
|
and if my vectors they have negative values....is it still applicable?
|
|
#4
|
||||
|
||||
|
Well, I don't know how to find the angle, but I'm guessing CVector3 is a typedef'd 3d vector of some numeric type. Your code looks just fine. Have you tested it?
__________________
-Aaron |
|
#5
|
|||
|
|||
|
oh....so how do i define CVector3? #define?
|
|
#6
|
||||
|
||||
|
Quote:
I believe this would do it... typedef vector < vector < vector < int > > > Cvector3; __________________
-Aaron |
|
#7
|
|||
|
|||
|
oh so i juz create a new cpp file n typedef CVector3? damn...im such a C++ failure
|
|
#8
|
||||
|
||||
|
Quote:
Yeah, but you have to know how to do a 3d vector first lol. I don't, so don't follow the example in the post above :-P __________________
-Aaron |
|
#9
|
|||
|
|||
|
oh man......
LOL~ alrite...at least i understand wat this whole vector thing is abt... which means i have to manually calculate the angles now... aaron, THANKS! Ur great! |
|
#10
|
||||
|
||||
|
Well, I feel bad taking credit when I didn't really do that much to help you, so hopefully you are able to solve this problem
__________________
-Aaron |
Recent GIDBlog
Welcome to Baghdad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2D vector | tay | C++ Forum | 9 | 05-May-2004 15:56 |
| Declaring a vector of vectors? | Lethal411 | C++ Forum | 2 | 20-Mar-2004 09:02 |
| vector prob | nattylife | C++ Forum | 1 | 15-Nov-2003 07:41 |
| vector sorting | gotnospoon | C++ Forum | 0 | 10-Nov-2003 15:26 |
| Something I have noticed about IE6 concerning site finding | jrobbio | Search Engine Optimization Forum | 0 | 10-Mar-2003 08:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The