本文整理汇总了C#中GeometryTutorLib.ConcreteAST.Segment.HasPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Segment.HasPoint方法的具体用法?C# Segment.HasPoint怎么用?C# Segment.HasPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryTutorLib.ConcreteAST.Segment
的用法示例。
在下文中一共展示了Segment.HasPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OtherPoint
public Point OtherPoint(Segment cs)
{
if (!cs.HasPoint(Point1)) return Point1;
if (!cs.HasPoint(Point2)) return Point2;
if (!cs.HasPoint(Point3)) return Point3;
return null;
}
示例2: LooseCrosses
public bool LooseCrosses(Segment that)
{
Point p = this.FindIntersection(that);
if (p == null) return false;
if (this.HasPoint(p) || that.HasPoint(p)) return false;
return LooseBetween(p, this.Point1, this.Point2) && LooseBetween(p, that.Point1, that.Point2);
}
示例3: IsRadius
//
// Is this a direct radius segment where one endpoint originates at the origin and extends outward?
// Return the exact radius.
private Segment IsRadius(Segment segment, List<Point> figPoints)
{
// The segment must originate from the circle center.
if (!segment.HasPoint(this.center)) return null;
// The segment must be at least as long as a radius.
if (!Utilities.CompareValues(segment.Length, this.radius)) return null;
Point nonCenterPt = segment.OtherPoint(this.center);
// Check for a direct radius.
if (this.PointLiesOn(nonCenterPt)) return segment;
//
// Check for an extended segment.
//
// radius
// center _____ circPt
//
// Find the exact coordinates of the 'circ' points.
//
Point inter1 = null;
Point inter2 = null;
this.FindIntersection(segment, out inter1, out inter2);
Point figPoint = Utilities.GetStructurally<Point>(figPoints, inter1);
if (figPoint == null) figPoint = Utilities.GetStructurally<Point>(figPoints, inter2);
return new Segment(center, figPoint);
}
示例4: OtherPoint
public Point OtherPoint(Segment seg)
{
if (seg.HasPoint(A) && seg.HasPoint(B)) return C;
if (seg.HasPoint(A) && seg.HasPoint(C)) return B;
if (seg.HasPoint(B) && seg.HasPoint(C)) return A;
if (seg.PointLiesOn(A) && seg.PointLiesOn(B)) return C;
if (seg.PointLiesOn(A) && seg.PointLiesOn(C)) return B;
if (seg.PointLiesOn(B) && seg.PointLiesOn(C)) return A;
return null;
}