/// <summary> /// out Upoint 未実装 /// </summary> /// <param name="l"></param> /// <param name="point"></param> /// <returns></returns> public IntersectType intersect(LDLine l, out LDPoint point) { IntersectType intersect; if (MathFunctions.uFuzzyCompare(this.angle(), l.angle())) { point = null; intersect = IntersectType.NoIntersection; } else { LDLine lp12 = new LDLine(this.pt1, l.pt1); LDLine lp22 = new LDLine(this.pt1, l.pt2); LDLine lp11 = new LDLine(l.pt1, this.pt1); LDLine lp21 = new LDLine(l.pt1, this.pt2); if (((this.angleTo(lp12) - 180f) * (this.angleTo(lp22) - 180f) < 0) && ((this.angleTo(lp11) - 180f) * (this.angleTo(lp21) - 180f) < 0)) { point = null; intersect = IntersectType.BoundedIntersection; } else { point = null; intersect = IntersectType.UnboundedIntersection; } } return(intersect); }
public float angleTo(LDLine l) { return l.angle() - this.angle() >= 0 ? l.angle() - this.angle() : l.angle() - this.angle() + 360; }
public float angleTo(LDLine l) { return(l.angle() - this.angle() >= 0 ? l.angle() - this.angle() : l.angle() - this.angle() + 360); }
/// <summary> /// out Upoint 未実装 /// </summary> /// <param name="l"></param> /// <param name="point"></param> /// <returns></returns> public IntersectType intersect(LDLine l, out LDPoint point) { IntersectType intersect; if (MathFunctions.uFuzzyCompare(this.angle(), l.angle())) { point = null; intersect = IntersectType.NoIntersection; } else { LDLine lp12 = new LDLine(this.pt1, l.pt1); LDLine lp22 = new LDLine(this.pt1, l.pt2); LDLine lp11 = new LDLine(l.pt1, this.pt1); LDLine lp21 = new LDLine(l.pt1, this.pt2); if (((this.angleTo(lp12) - 180f) * (this.angleTo(lp22) - 180f) < 0) && ((this.angleTo(lp11) - 180f) * (this.angleTo(lp21) - 180f) < 0)) { point = null; intersect = IntersectType.BoundedIntersection; } else { point = null; intersect = IntersectType.UnboundedIntersection; } } return intersect; }