Ejemplo n.º 1
0
	/* PUBLIC MEMBER FUNCTIONS */
	float Vector2f::getAngle(const Vector2f &v) const
	{
		// WARNING: this may not work

		float length = (getMagnitude() * v.getMagnitude());
        if (length == 0.0f)
        {
            return 0.0f;
        }
        
		return (float)acos(getDotProduct(v) / length);
	}
Ejemplo n.º 2
0
	float Vector2f::getScaleFactor(const Vector2f &v) const
	{
		return getMagnitude() / v.getMagnitude();
	}