Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top