- #1
teken894
- 25
- 0
I have this physics problem that I have no clue how to approach...
Here's the given info:
A ball is launched at a 60 deg angle toward a target. The coordiantes of the origin is (0,0), and the coordinates of the target is (16,0). What would be the power required units/second to get the ball to reach the target?
This is for a computer programming class, so I need to use vector math to find the x and y components, from there, I will graph the equation..
if you understand the code below: I need to find the initial velocity required from the sample problem above...
Here is the pseudo code:
(This is a repetitive code, stopping only when Y < 0)
First we find the separate X and Y components based on the initial AngleInRadians and initial Velocity.
X-component = sin(AngleInRadians) * Velocity
Y-component = cos(AngleInRadians) * Velocity - Gravity-Constant
Then, using the separate components, we calculate the actual velocity of the projectile.
Velocity = sqrt(X-componenet^2 + Y-Component^2)
Moreover, we calculate the actual Angle of the projectile for this block of code...
AngleInRadians = ArcTangent(X-Component/Y-Component)
Using the above calculated info, we can now place the (object) according to the calculated velocity and Angle, adding the calculated values based upon the previous position.
Object(Ball).X = PreviousObject(Ball).X + Velocity * sin(AngleInRadians)
Object(Ball).Y = PreviousObject(Ball).Y + Velocity * cos(AngleInRadians)
As you can see, there is no "time" involved. All of the info is calculated using trignometry (sin, cos, arctan) and new vectors are found based on the previous trajectory of the object.
Now, If I were provided another point where X = 16, and Y=2, how would I approach in solving for the initial velocity of the projectile which will start at the origin and intercept the given point?
edit:
Is there a forumla for finding initial velocy given range? I saw on some website that for 45 degree angle
init velocity = sqrt(gravity*range)
and for 90 deg angle
init velocity - sqrt(2*g*height)
is there such formulas if the angle is, say 60 degs or 75 degs?
edit 2:
yes, i want to reach (16,0) not (0,16)...sorry typo
I could use time, but I am not using that as a variable in my graphing code. As you could see, my code does not involve the variable "T" at all..
Also, I need functionality to be able to base the graph when y is not 0, so I cannot simply use the two equations to find the y-intercepts.
Here's the given info:
A ball is launched at a 60 deg angle toward a target. The coordiantes of the origin is (0,0), and the coordinates of the target is (16,0). What would be the power required units/second to get the ball to reach the target?
This is for a computer programming class, so I need to use vector math to find the x and y components, from there, I will graph the equation..
if you understand the code below: I need to find the initial velocity required from the sample problem above...
Here is the pseudo code:
(This is a repetitive code, stopping only when Y < 0)
First we find the separate X and Y components based on the initial AngleInRadians and initial Velocity.
X-component = sin(AngleInRadians) * Velocity
Y-component = cos(AngleInRadians) * Velocity - Gravity-Constant
Then, using the separate components, we calculate the actual velocity of the projectile.
Velocity = sqrt(X-componenet^2 + Y-Component^2)
Moreover, we calculate the actual Angle of the projectile for this block of code...
AngleInRadians = ArcTangent(X-Component/Y-Component)
Using the above calculated info, we can now place the (object) according to the calculated velocity and Angle, adding the calculated values based upon the previous position.
Object(Ball).X = PreviousObject(Ball).X + Velocity * sin(AngleInRadians)
Object(Ball).Y = PreviousObject(Ball).Y + Velocity * cos(AngleInRadians)
As you can see, there is no "time" involved. All of the info is calculated using trignometry (sin, cos, arctan) and new vectors are found based on the previous trajectory of the object.
Now, If I were provided another point where X = 16, and Y=2, how would I approach in solving for the initial velocity of the projectile which will start at the origin and intercept the given point?
edit:
Is there a forumla for finding initial velocy given range? I saw on some website that for 45 degree angle
init velocity = sqrt(gravity*range)
and for 90 deg angle
init velocity - sqrt(2*g*height)
is there such formulas if the angle is, say 60 degs or 75 degs?
edit 2:
yes, i want to reach (16,0) not (0,16)...sorry typo
I could use time, but I am not using that as a variable in my graphing code. As you could see, my code does not involve the variable "T" at all..
Also, I need functionality to be able to base the graph when y is not 0, so I cannot simply use the two equations to find the y-intercepts.
Last edited: