Ejemplo n.º 1
0
        private static double GetHto(BasinDotProduct basin, NeighborVert direction)
        {
            Basin3 inter;

            /*if (basin.Type.HasValue && NeighborManager.GetVert(basin.Type.Value) == direction)
             * {
             *  var neibor = basin.Neibors[NeighborManager.GetOppositeHor(basin.Type.Value)];
             *  inter = neibor;
             * }
             * else*/
            {
                Basin3 east;
                Basin3 west;
                if (direction == NeighborVert.North)
                {
                    east = basin.Neibors[Direction.Ne];
                    west = basin.Neibors[Direction.Nw];
                }
                else
                {
                    east = basin.Neibors[Direction.Se];
                    west = basin.Neibors[Direction.Sw];
                }

                inter = new Basin3
                {
                };
                var lambda = (east.Lambda + west.Lambda).Value / 2;
                inter.Qb = new Point2D(.5 * (east.Qb.X + west.Qb.X)
                                       //correct projection
                                       * Math.Cos(basin.Lambda.Value - lambda),
                                       .5 * (east.Qb.Y + west.Qb.Y));
            }
            return(basin.Intersect(inter));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// for meridian projection
        /// </summary>
        internal double Move(MeridianCoor basin, MeridianCoor toBasin, NeighborVert to)
        {
            var from = 1 - (int)to;

            return(toBasin == null
                ? 0
                : PutV(basin, toBasin,
                       (basin.Hto[(int)to] - toBasin.Hto[from]) / 2,
                       (int)to,
                       from));
        }