本文整理汇总了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;
}