Saturday, May 26, 2018

mathematics - Scale a normalized 2D vector always to the same length


For any normalized 2D vector, except for ( 0, 0 ), how would I scale the vector to always be the same length?


For example:



int length = 10;

vector v = vector( 0.1, 0.5 );
vector v2 = vector( 0.3, 0.8 );

// Scale v to be length of 10
// Scale v2 to be length of 10


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...