Search code examples
mathgreatest-common-divisor

Normalize a vector differently than normal


I have a vector that represents the change between one vector and another. The vectors are always diagonal to each other. For example, if the first vector was (1, 0) and the second was(3, 2), the change is (2, 2), which should be normalized to (1, 1). "Normal" normalizing by dividing both X and Y with the vector's length results in about 2.83 for the example vector which is not what I need. How can I achieve this "normalization"?


Solution

  • Divide both components of your vector by their greatest common divisor.