Vector.Divide(Vector, Double) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定向量除以指定标量,并将结果以 Vector 形式返回。
public:
static System::Windows::Vector Divide(System::Windows::Vector vector, double scalar);
public static System.Windows.Vector Divide (System.Windows.Vector vector, double scalar);
static member Divide : System.Windows.Vector * double -> System.Windows.Vector
Public Shared Function Divide (vector As Vector, scalar As Double) As Vector
参数
- vector
- Vector
作为除数的向量结构。
- scalar
- Double
vector
的被除量。
返回
vector
除以 scalar
的结果。
示例
以下示例演示如何使用此方法除 Vector 以标量。
private Vector divideExample()
{
Vector vector1 = new Vector(20, 30);
Vector vectorResult = new Vector();
Double scalar1 = 75;
// Divide vector by scalar.
// vectorResult is approximately equal to (0.26667,0.4)
vectorResult = Vector.Divide(vector1, scalar1);
return vectorResult;
}