How to Change a Horizontal Vector to Move in a 45 degree angle

In summary, vPython thinks the < , , > item is a velocity vector, with the individual parameters specifying the speed in the x,y,z directions. To keep the speed the same but change the direction, you want to have speed = \sqrt{vx^2 + vy^2 + vz^2}.
  • #1
Loppyfoot
194
0

Homework Statement


I am using vPython, and object moves in a +x direction with a vector of <1e7,0,0>m. I need to now change the vector so that it now moves in the same +x direction, but also moving in the northeast direction at an angle of 45 degrees.

The Attempt at a Solution


I attempted <1e7,1e7,0>, and it looks similar to what I need, but I don't know if it is exact or correct.

Thanks for your help.
 
Physics news on Phys.org
  • #2
Loppyfoot said:

Homework Statement


I am using vPython, and object moves in a +x direction with a vector of <1e7,0,0>m. I need to now change the vector so that it now moves in the same +x direction, but also moving in the northeast direction at an angle of 45 degrees.

The Attempt at a Solution


I attempted <1e7,1e7,0>, and it looks similar to what I need, but I don't know if it is exact or correct.

Thanks for your help.

That will depend upon what vPython thinks the < , , > item is. Is it a velocity vector, with the individual parameters specifying the speed in the x,y,z directions? If so, and you want to keep the speed the same but change the direction, you want to have

[tex]speed = \sqrt{vx^2 + vy^2 + vz^2}[/tex]

If you're dealing with just the x and y directions (planar motion), then you can set your speed and direction as:

[tex] vx = speed \cdot cos(\theta)[/tex]
[tex] vy = speed \cdot sin(\theta)[/tex]

where [tex]\theta[/tex] is the desired direction angle, and use these values as the parameters.

Putting the same value for both the x and y parameters gave you a 45 degree angle, but probably increased the overall speed by a factor of [tex]\sqrt{2}[/tex]
 
  • #3
Ok, I get it, and I got it working. Thanks for your help.
 
  • #4
Where do you get the formula:
vx = speed * sin (45)?

Thanks.
 
  • #5
Loppyfoot said:
Where do you get the formula:
vx = speed * sin (45)?

Thanks.

That's vx = speed * cos(45)

It's basic trigonometry for a right-angle triangle. Vectors in the x and y directions add like the sides of a right angle triangle to form the hypotenuse. The trigonometric functions, sine and cosine, encapsulate the relationships between the angle and the ratios of the lengths of the sides to the hypotenuse.
 
  • #6
Ok, So the x-component is 1e7cos(45), where the y-component is 1e7sin(45), so the hypotenuse is the vector that makes up both of these components, which allows the object to move in the direction that is 45 degrees from the horizontal.

Is that a decent understanding? Thanks for your help.
 
  • #7
That's fine. You're good to go!
 

1. How do I change a horizontal vector to move in a 45 degree angle?

To change a horizontal vector to move in a 45 degree angle, you will need to break down the vector into its horizontal and vertical components. Then, use trigonometric functions such as sine and cosine to calculate the new values for the vector components. Finally, recombine the components to create a new vector that moves at a 45 degree angle.

2. What is the formula for converting a horizontal vector to a 45 degree angle?

The formula for converting a horizontal vector to a 45 degree angle is as follows: new horizontal component = original horizontal component * cos(45°) and new vertical component = original horizontal component * sin(45°). These new components can then be combined to create the new vector.

3. Can I use this method to change a vector to any angle?

Yes, this method can be used to change a vector to any angle by adjusting the angle in the trigonometric functions. For example, to change a vector to a 30 degree angle, you would use cos(30°) and sin(30°) in the formula instead of cos(45°) and sin(45°).

4. Is there a simpler way to change a vector to a 45 degree angle?

There is no simpler way to change a vector to a 45 degree angle. However, some programming languages may have built-in functions or methods for converting vectors to a specific angle, so it is important to check the documentation of your language.

5. Does changing a vector's direction affect its magnitude?

Changing a vector's direction does not affect its magnitude. The magnitude of a vector is determined by its length, which remains the same regardless of its direction. However, the vector's components and resulting movement will change when its direction is altered.

Similar threads

  • Introductory Physics Homework Help
Replies
23
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
13
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
708
Replies
15
Views
4K
  • Introductory Physics Homework Help
Replies
4
Views
1K
Back
Top