Derek Nickerson wrote:The problem I have is what to do when more than one JTF in the array is left empty -- meaning more than one unknownVar.
Derek Nickerson wrote:Yeah, I know you guys are busy and its probably a pain to read through so much code and I just wanted you to be able to see it in its entirety. I will post the snippets of code that are the problem areas.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Derek Nickerson wrote:As far as calculating for different equations (the 5 kinematics equations, 4 or 5 dynamics..etc), I stuck with just one equation for each topic. Trying to account for more than one empty JTF array (or variable) in the checkJTF method was a problem I just couldn't figure out. Do you guys know how I could have fixed that issue? I completed the code last night after choosing to just solve for one variable using one equation. I plan to do more work on this code and would like to improve upon it, so I will likely go back to try and put each (topic)Calculator method into its own class to start with. But I still need to figure out how to use more equations than one and solve for more than one unknown.
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
K. Tsang wrote:
Imagine you can calculate multiple unknowns in your "calculateXXX" methods. Passing in the unknown variables would just be passing in an array of ints or varargs of ints. The real problem is inside the calculateXXX() method. I see your current approach is using an if statement then case inside. If the passed in parameter is array, the if statement can easily turn into a for loop.
Anyway, I'm no physics or math guy much but I'm sure there are formulae for solving such equations more easier than whole bunch of case statements.
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Derek Nickerson wrote:I know that the program will need to verify enough data field (JTF) include data in order for any equations to work
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Derek Nickerson wrote:...I need to first find the right equation to used to solve for velocity -- then go back and solve for distance. I'm just not seeing how I can do that in code.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Popeye has his spinach. I have this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|