Setting a vector to another magnitude

  • Context: Undergrad 
  • Thread starter Thread starter wraithseeker
  • Start date Start date
  • Tags Tags
    Magnitude Vector
Click For Summary
SUMMARY

The discussion focuses on the mathematical process of adjusting the magnitude of a vector in three-dimensional space. The key formula presented is v' = (v / oldlength) * newlength, where 'v' is the original vector, 'oldlength' is its magnitude, and 'newlength' is the desired magnitude. This method involves first normalizing the vector to create a unit vector and then scaling it to the new length. The conversation also touches on the implications of directionality in vector manipulation, particularly in Cartesian, cylindrical, and spherical coordinate systems.

PREREQUISITES
  • Understanding of vector mathematics
  • Familiarity with Cartesian, cylindrical, and spherical coordinate systems
  • Knowledge of vector normalization techniques
  • Basic proficiency in mathematical operations involving square roots
NEXT STEPS
  • Research vector normalization techniques in 3D graphics
  • Explore the implications of vector directionality in physics simulations
  • Learn about coordinate transformations between Cartesian and spherical coordinates
  • Investigate the use of vectors in game development frameworks like Unity or Unreal Engine
USEFUL FOR

This discussion is beneficial for mathematicians, computer graphics developers, and game developers who need to manipulate vector magnitudes and understand the implications of directionality in their applications.

wraithseeker
Messages
28
Reaction score
0
When you set it, initially I have to do

length = Sqrt(x*x+y*y*z*z)
length = newlength/length
set all the velocities to multiply by length

I am wondering what is this for?

length = newlength/length
 
Science news on Phys.org
newlength/oldlength is the fraction by which the length has to increase. The length of the new vector will be
|| oldvector * newlength / oldlength || = || oldvector || * newlength / oldlength = oldlength * newlength / oldlenght.

Alternatively, you can look at it this way: if you have a vector v, first divide it by its length to make a unit vector u (in the same direction but with length 1). Then multiply u by the length you want it to have to get the new vector:
v' = u * newlength = (v / oldlength) * newlength = v * (newlength / oldlength)
where oldlength is the length of v (sqrt(x^2 + y^2 + z^2)).
 
Well, you're talking about a vector, so I assume direction is important. It would be easier to change leingths of individual cartesian components by the desired amount. In cylindrical and sphercal, you merely change r.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 12 ·
Replies
12
Views
3K
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K