- #1
KingNothing
- 881
- 4
Hello...I really want to make a program that can do vector addition and subtraction, given two or more vectors. The problem is, I'm not sure of the math that would be needed to do it. See, I want the person to be able to enter two or more vectors with a magnitude (length) and angle (with 0 degrees being 'up' and 90 degrees being 'right'). I'm struggling a bit with the actual math that needs to be done. I can do it on paper just fine, because the process of taking a bearing of 1125 degrees and making it 45, etc, things of this nature - is logical. But programs don't understand logic. That's where I hit the roadblock.
I don't think you need to know any programming whatsoever to answer this (granted you know the answer)...just be able to say things like:
1. Sbtract angle a from angle b, save to variable a.
etcetera. I'd a little fuzzy on the part of figuring out how to "get two vectors together" to be prepared to use the law of cosines and whatnot to figure the resultant out. Can you help?
I don't think you need to know any programming whatsoever to answer this (granted you know the answer)...just be able to say things like:
1. Sbtract angle a from angle b, save to variable a.
etcetera. I'd a little fuzzy on the part of figuring out how to "get two vectors together" to be prepared to use the law of cosines and whatnot to figure the resultant out. Can you help?