本文整理匯總了C#中System.Point.dotProduct方法的典型用法代碼示例。如果您正苦於以下問題:C# Point.dotProduct方法的具體用法?C# Point.dotProduct怎麽用?C# Point.dotProduct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Point
的用法示例。
在下文中一共展示了Point.dotProduct方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: projectPoint
public Point projectPoint(Point point, Point normal, double d)
{
double t = (point.dotProduct(normal) - d) / normal.dotProduct(normal);
Point result = point.subtract(normal.multiply(t));
return result;
}
示例2: pointDotProductTest
public void pointDotProductTest()
{
double expected = 3;
double a1 = 1.0;
double a2 = 3.0;
double a3 = -5.0;
double b1 = 4.0;
double b2 = -2.0;
double b3 = -1.0;
Point a = new Point(3);
a.p[0] = a1;
a.p[1] = a2;
a.p[2] = a3;
Point b = new Point(3);
b.p[0] = b1;
b.p[1] = b2;
b.p[2] = b3;
Assert.AreEqual(expected, a.dotProduct(b));
}
示例3: projection
private Point projection(Point u, Point v)
{
Point result = null;
result = u.multiply(u.dotProduct(v)/u.dotProduct(u));
return result;
}