本文整理匯總了C#中System.Point.subtract方法的典型用法代碼示例。如果您正苦於以下問題:C# Point.subtract方法的具體用法?C# Point.subtract怎麽用?C# Point.subtract使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Point
的用法示例。
在下文中一共展示了Point.subtract方法的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: pointSubstractTest
public void pointSubstractTest()
{
double a1 = 4.0;
double a2 = 3.5;
double b1 = 2.0;
double b2 = 4.0;
Point a = new Point(2);
a.p[0] = a1;
a.p[1] = a2;
Point b = new Point(2);
b.p[0] = b1;
b.p[1] = b2;
Point result = a.subtract(b);
Assert.AreEqual(a1 - b1, result.p[0]);
Assert.AreEqual(a2 - b2, result.p[1]);
}
示例3: prepareVectors
public List<Point> prepareVectors(Point p)
{
List<Point> pointList = new List<Point>();
for (int i = 0; i < p.Dimensions-1; i++)
{
pointList.Add(generator.generatePoint(p.Dimensions));
}
for (int i =0; i< pointList.Count;i++)
{
Point point = pointList.ElementAt(i);
pointList[i] = p.subtract(point);
}
return pointList;
}