Exemplo n.º 1
0
        /// <summary>
        /// Given two Edges, determine the angular bisector direction between them that lies
        /// in the anticlockwise angle from edge1 to edge2.
        /// </summary>
        /// <param name="edge1">The first edge</param>
        /// <param name="edge2">The second edge</param>
        /// <returns>A Direction2D that bisects the angle between edge1 and edge2</returns>
        private static Direction2D AngularBisector(Edge edge1, Edge edge2)
        {
            // TODO: Refactor to use Edge.Vector
            Vector2D v1 = edge1.target.Position - edge1.source.Position;
            Vector2D v2 = edge2.target.Position - edge2.source.Position;

            return(VectorGeometry.Bisector(ref v1, ref v2));
        }
Exemplo n.º 2
0
        public void AcuteBisector180()
        {
            Vector2D    v1 = new Vector2D(1.0, 0.0);
            Vector2D    v2 = new Vector2D(-1.0, 0.0);
            Direction2D d  = VectorGeometry.Bisector(ref v1, ref v2);

            Assert.AreEqual(new Direction2D(-1.0, 0.0), d);
        }