Vector.Multiply メソッド
定義
オーバーロード
Multiply(Double, Vector) |
指定したスカラーと指定したベクターを乗算し、その結果の Vector を返します。Multiplies the specified scalar by the specified vector and returns the resulting Vector. |
Multiply(Vector, Double) |
指定したベクターと指定したスカラーを乗算し、その結果の Vector を返します。Multiplies the specified vector by the specified scalar and returns the resulting Vector. |
Multiply(Vector, Matrix) |
指定したベクターの座標空間を、指定した Matrix を使用して変換します。Transforms the coordinate space of the specified vector using the specified Matrix. |
Multiply(Vector, Vector) |
2 つの指定したベクターのドット積を計算し、その結果を Double として返します。Calculates the dot product of the two specified vectors and returns the result as a Double. |
Multiply(Double, Vector)
指定したスカラーと指定したベクターを乗算し、その結果の Vector を返します。Multiplies the specified scalar by the specified vector and returns the resulting Vector.
public:
static System::Windows::Vector Multiply(double scalar, System::Windows::Vector vector);
public static System.Windows.Vector Multiply (double scalar, System.Windows.Vector vector);
static member Multiply : double * System.Windows.Vector -> System.Windows.Vector
パラメーター
- scalar
- Double
乗算するスカラー。The scalar to multiply.
- vector
- Vector
乗算するベクトル。The vector to multiply.
戻り値
scalar
と vector
を乗算した結果。The result of multiplying scalar
and vector
.
例
次の例では、このメソッドを使用してVectorスカラーをに乗算する方法を示します。The following example shows how to use this method to multiply a scalar by a Vector.
private Vector multiplyVectorByScalarExample2()
{
Vector vector1 = new Vector(20, 30);
Double scalar1 = 75;
Vector vectorResult = new Vector();
// Multiply the vector by the scalar.
// vectorResult is equal to (1500,2250)
vectorResult = Vector.Multiply(scalar1, vector1);
return vectorResult;
}
こちらもご覧ください
Multiply(Vector, Double)
指定したベクターと指定したスカラーを乗算し、その結果の Vector を返します。Multiplies the specified vector by the specified scalar and returns the resulting Vector.
public:
static System::Windows::Vector Multiply(System::Windows::Vector vector, double scalar);
public static System.Windows.Vector Multiply (System.Windows.Vector vector, double scalar);
static member Multiply : System.Windows.Vector * double -> System.Windows.Vector
パラメーター
- vector
- Vector
乗算するベクトル。The vector to multiply.
- scalar
- Double
乗算するスカラー。The scalar to multiply.
戻り値
vector
と scalar
を乗算した結果。The result of multiplying vector
and scalar
.
例
次の例は、このメソッドを使用して、 Vectorをスカラーで乗算する方法を示しています。The following example shows how to use this method to multiply a Vector by a scalar.
private Vector multiplyVectorByScalarExample1()
{
Vector vector1 = new Vector(20, 30);
Double scalar1 = 75;
Vector vectorResult = new Vector();
// Multiply the vector by the scalar.
// vectorResult is equal to (1500,2250)
vectorResult = Vector.Multiply(vector1, scalar1);
return vectorResult;
}
こちらもご覧ください
Multiply(Vector, Matrix)
指定したベクターの座標空間を、指定した Matrix を使用して変換します。Transforms the coordinate space of the specified vector using the specified Matrix.
public:
static System::Windows::Vector Multiply(System::Windows::Vector vector, System::Windows::Media::Matrix matrix);
public static System.Windows.Vector Multiply (System.Windows.Vector vector, System.Windows.Media.Matrix matrix);
static member Multiply : System.Windows.Vector * System.Windows.Media.Matrix -> System.Windows.Vector
パラメーター
- vector
- Vector
変換するベクター構造体。The vector structure to transform.
- matrix
- Matrix
vector
に適用する変換。The transformation to apply to vector
.
戻り値
vector
を matrix
で変換した結果。The result of transforming vector
by matrix
.
例
このメソッドを使用しVector Matrixてをに乗算する方法を次の例に示します。The following example shows how to use this method to multiply a Vector by a Matrix.
private Vector multiplyVectorByMatrixExample()
{
Vector vector1 = new Vector(20, 30);
Matrix matrix1 = new Matrix(40, 50, 60, 70, 80, 90);
Vector vectorResult = new Vector();
// Multiply the vector and matrix.
// vectorResult is equal to (2600,3100).
vectorResult = Vector.Multiply(vector1, matrix1);
return vectorResult;
}
こちらもご覧ください
Multiply(Vector, Vector)
2 つの指定したベクターのドット積を計算し、その結果を Double として返します。Calculates the dot product of the two specified vectors and returns the result as a Double.
public:
static double Multiply(System::Windows::Vector vector1, System::Windows::Vector vector2);
public static double Multiply (System.Windows.Vector vector1, System.Windows.Vector vector2);
static member Multiply : System.Windows.Vector * System.Windows.Vector -> double
Public Shared Function Multiply (vector1 As Vector, vector2 As Vector) As Double
パラメーター
- vector1
- Vector
乗算する最初のベクター。The first vector to multiply.
- vector2
- Vector
乗算する 2 番目のベクター構造体。The second vector structure to multiply.
戻り値
次の数式で計算された vector1
と vector2
のスカラー ドット積を含む Double。A Double containing the scalar dot product of vector1
and vector2
, which is calculated using the following formula:
(vector1.X * vector2.X) + (vector1.Y * vector2.Y)
(vector1.X * vector2.X) + (vector1.Y * vector2.Y)
例
このメソッドを使用しVector Vectorてをに乗算する方法を次の例に示します。The following example shows how to use this method to multiply a Vector by a Vector.
private Double getDotProductExample()
{
Vector vector1 = new Vector(20, 30);
Vector vector2 = new Vector(45, 70);
Double doubleResult;
// Return the dot product of the two specified vectors.
// The dot product is calculated using the following
// formula: (vector1.X * vector2.X) + (vector1.Y * vector2.Y).
// doubleResult is equal to 3000
doubleResult = Vector.Multiply(vector1, vector2);
return doubleResult;
}