public static VCircleEvent CircleCheckDataNode(VDataNode n, double ys) { var l = LeftDataNode(n); var r = RightDataNode(n); if (l == null || r == null || l.DataPoint == r.DataPoint || l.DataPoint == n.DataPoint || n.DataPoint == r.DataPoint) { return(null); } if (MathTools.ccw(l.DataPoint[0], l.DataPoint[1], n.DataPoint[0], n.DataPoint[1], r.DataPoint[0], r.DataPoint[1], false) <= 0) { return(null); } var center = Fortune.CircumCircleCenter(l.DataPoint, n.DataPoint, r.DataPoint); var vc = new VCircleEvent { NodeN = n, NodeL = l, NodeR = r, Center = center, Valid = true }; if (vc.Y > ys || Math.Abs(vc.Y - ys) < 1e-10) { return(vc); } return(null); }
public static VCircleEvent CircleCheckDataNode(VDataNode n, float ys) { VDataNode l = VNode.LeftDataNode(n); VDataNode r = VNode.RightDataNode(n); if (l == null || r == null || l.DataPoint == r.DataPoint || l.DataPoint == n.DataPoint || n.DataPoint == r.DataPoint) { return(null); } if (MathTools.ccw(l.DataPoint[0], l.DataPoint[1], n.DataPoint[0], n.DataPoint[1], r.DataPoint[0], r.DataPoint[1], false) <= 0) { return(null); } Vector3 Center = Fortune.CircumCircleCenter(l.DataPoint, n.DataPoint, r.DataPoint); VCircleEvent VC = new VCircleEvent(); VC.NodeN = n; VC.NodeL = l; VC.NodeR = r; VC.Center = Center; VC.Valid = true; if (VC.Y >= ys) { return(VC); } return(null); }
public static VCircleEvent CircleCheckDataNode(VDataNode n, double ys) { VDataNode l = VNode.LeftDataNode(n); VDataNode r = VNode.RightDataNode(n); if (l == null || r == null || l.DataPoint == r.DataPoint || l.DataPoint == n.DataPoint || n.DataPoint == r.DataPoint) { return(null); } if (MathF.ccw(l.DataPoint.X, l.DataPoint.Y, n.DataPoint.X, n.DataPoint.Y, r.DataPoint.X, r.DataPoint.Y, false) <= 0) { return(null); } Point Center = Fortune.CircumCircleCenter(l.DataPoint, n.DataPoint, r.DataPoint); VCircleEvent VC = new VCircleEvent(); VC.NodeN = n; VC.NodeL = l; VC.NodeR = r; VC.Center = Center; VC.Valid = true; if (VC.Y > ys || Math.Abs(VC.Y - ys) < 1e-10) { return(VC); } return(null); }