コード例 #1
0
ファイル: LDLine.cs プロジェクト: johndpope/math
        /// <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);
        }
コード例 #2
0
ファイル: LDLine.cs プロジェクト: KajitaLD/math
 public float angleTo(LDLine l)
 {
     return l.angle() - this.angle() >= 0 ? l.angle() - this.angle() : l.angle() - this.angle() + 360;
 }
コード例 #3
0
ファイル: LDLine.cs プロジェクト: johndpope/math
 public float angleTo(LDLine l)
 {
     return(l.angle() - this.angle() >= 0 ? l.angle() - this.angle() : l.angle() - this.angle() + 360);
 }
コード例 #4
0
ファイル: LDLine.cs プロジェクト: KajitaLD/math
        /// <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;
        }