Basically I have a part of my program (it’s for Vector solving) that is supposed to take data from two lists (listVectorMagnitude and listVectorAngle), and then run them through a function
in a separate class (vectorXComponent), and then return the value. How exactly would I go about taking the first value in listVectorMagnitude, the first value in listVectorAngle, and then use them as parameters in the vectorXComponent function? It would iterate over this process for as many values are in the lists. Thank you.
Basically I have a part of my program (it’s for Vector solving) that is
Share
You didn’t give a lot of detail. I’ll assume that you have an instance of a class
Barnamedbar, and that class has a method namedvectorXComponent. Additionally, I assume that the return type ofBar.vectorXComponentisFoo.The modern functional way:
Or, an old-fashioned
forloop: