Making Vector Addition programmeable

Click For Summary
SUMMARY

The discussion focuses on creating a program for vector addition and subtraction, specifically for handling two or more vectors defined by their magnitude and angle. The user seeks clarity on the mathematical processes required, particularly in converting vectors to components and applying the law of cosines. Key steps include subtracting angles and converting vectors into a usable format for calculations. The conversation emphasizes the need for a structured approach to vector mathematics in programming.

PREREQUISITES
  • Understanding of vector components and their representation
  • Familiarity with trigonometric functions (sine, cosine)
  • Knowledge of the law of cosines
  • Basic programming concepts for implementing mathematical operations
NEXT STEPS
  • Research how to convert vectors to Cartesian coordinates
  • Learn about implementing trigonometric functions in programming languages
  • Study the law of cosines and its application in vector mathematics
  • Explore programming libraries that facilitate vector calculations, such as NumPy for Python
USEFUL FOR

Mathematicians, physics students, software developers, and anyone interested in implementing vector mathematics in programming projects.

KingNothing
Messages
880
Reaction score
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?
 
Physics news on Phys.org
Convert each of the vectors to components in some basis, then add the components.

- Warren
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 26 ·
Replies
26
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 25 ·
Replies
25
Views
5K
  • · Replies 3 ·
Replies
3
Views
9K
Replies
3
Views
2K
Replies
33
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K