Vector math/physics question.

Started by
1 comment, last by Qoy 23 years, 3 months ago
I''m writing a gravitation demo for my physics class, and I''m not really having a "problem" but there''s something that I would like to do a better way, that I think can probably be made better. OK, during all my vector calculations, I''m keeping my vectors in components for ease of use. This is fine for calculating acceleration based on force, velocity based on acceleration, etc., but for calculating gravitational force based on distance and mass (Fgrav = (Gm1m2)/(d^2) ) calculating in components doesn''t work because distance is the vector quantity in the equation, and it''s squared instead of just multiplied. At least, that''s the only reason I can think of that it doesn''t work, but it turns out that that equation (I guess because of the square) only gives a total vector magnitude, and does not work out correctly when calculating in components. So currently I''m calculating the total magnitude and then separating it into x and y components to return it to my other functions in the hopes that I''ll be able to find a way to calculate it in components right off and can replace what I''m currently doing with that. Does anyone have any idea what I can do to get the force in components, despite the vector being squared in the equation? (Or was my situation clear enough?)
Advertisement
Well I don''t know if I am right - I may be wrong - but this is how vector is done in physics - lol I may be totally off the question coz basically it went over my head.

Consider you have a force F - however you have calcuated it. Generally you would use F * (cos value) for horizontal component
and F * (sin value) for vertical component. This is how you get the component values. The total magnitude is given by sqrt(Horizontal Component^2 + Vertcial Component^2).



Hello from my world
Hello from my world
In vector based physics you rarely resort to sin''s & cos''s, its kinda an advantage of doing stuff with vectors.

Calculate the gravitational force
Create a vector from the center of one mass to the other
Normalize it
Mutliple by the grav. force
Voila, the force vector
Reverse the vector, apply to other mass

PS If you get the vector directions backwars you''ll create anti-grav
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement