سؤال

What's the difference between a vector described with magnitude and angle and one described by x and y? Or are they the same, just expressed differently?

هل كانت مفيدة؟

المحلول

There is a bijection of the two representations and you can use this:

x = r*cos(alpha);
y = r*sin(alpha);

So the two representation effectively do the same. Still one is to be preferred over the other for certain tasks. For instance rotation is easier if vector is expressed using magnitude and angle. On the other hand dot product is easier to compute using coordinates x and y.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top