本文整理汇总了C#中GeometryTutorLib.ConcreteAST.Segment.StructurallyEquals方法的典型用法代码示例。如果您正苦于以下问题:C# Segment.StructurallyEquals方法的具体用法?C# Segment.StructurallyEquals怎么用?C# Segment.StructurallyEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryTutorLib.ConcreteAST.Segment
的用法示例。
在下文中一共展示了Segment.StructurallyEquals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOtherSides
public void GetOtherSides(Segment s, out Segment outSeg1, out Segment outSeg2)
{
outSeg1 = null;
outSeg2 = null;
if (s.StructurallyEquals(SegmentA))
{
outSeg1 = SegmentB;
outSeg2 = SegmentC;
}
else if (s.StructurallyEquals(SegmentB))
{
outSeg1 = SegmentA;
outSeg2 = SegmentC;
}
else if (s.StructurallyEquals(SegmentC))
{
outSeg1 = SegmentA;
outSeg2 = SegmentB;
}
}
示例2: IsIncludedAngle
//
// Do these segments overlay this angle?
//
public bool IsIncludedAngle(Segment seg1, Segment seg2)
{
// Do not allow the same segment.
if (seg1.StructurallyEquals(seg2)) return false;
// Check direct inclusion
if (seg1.Equals(ray1) && seg2.Equals(ray2) || seg1.Equals(ray2) && seg2.Equals(ray1)) return true;
// Check overlaying angle
Point shared = seg1.SharedVertex(seg2);
if (shared == null) return false;
Angle thatAngle = new Angle(seg1.OtherPoint(shared), shared, seg2.OtherPoint(shared));
return this.Equates(thatAngle);
}
示例3: CalcSides
private List<KeyValuePair<Segment, double>> CalcSides(RightTriangle tri, Angle rightAngle, Angle knownAngle, double knownAngleVal, Segment knownSeg, double knownSegVal)
{
//
// Determine the nature of the known Segment w.r.t. to the known angle.
//
Segment hypotenuse = tri.GetHypotenuse();
// Hypotenuse known
if (knownSeg.StructurallyEquals(hypotenuse))
{
return CalcSidesHypotenuseKnown(tri, knownAngle, knownAngleVal, hypotenuse, knownSegVal);
}
else
{
return CalcSidesHypotenuseUnknown(tri, knownAngle, knownAngleVal, knownSeg, knownSegVal);
}
}
示例4: GetSegmentLength
public double GetSegmentLength(Segment thatSeg)
{
if (thatSeg == null)
{
// throw new ArgumentException("Why is the angle null?");
return -1;
}
foreach (KeyValuePair<Segment, double> segPair in segments)
{
if (thatSeg.StructurallyEquals(segPair.Key)) return segPair.Value;
}
return -1;
}