예제 #1
0
        public override double Intersect(BasinBase otherBasin)
        {
            var other = (MeridianBase)otherBasin;
            var Qt    = new Vector2D(
                other.Q.X * Math.Cos(Lambda.Value - otherBasin.Lambda.Value),
                other.Q.Y);

            Beta_traverse = Qt.AngleTo(Qb /*or Q?*/.ToVector2D()).Radians;
            return(Triangles.SinusesTheorem(
                       Math.PI / 2 + Delta_g_meridian,
                       r,
                       Beta_traverse)
                   -
                   //r;
                   otherBasin.r); //there's deformation
        }
예제 #2
0
        /// <param name="height">>0 when water is moved from basin</param>
        /// <returns>some volume moved from basin</returns>
        public double PutV(BasinBase basin, BasinBase toBasin, double height, int to, int from)
        {
            if (Math.Abs(height) > Threshhold)
            {
                // must be transaction
                if (!toBasin.Volumes[from] && !basin.Volumes[to])
                {
                    var    k          = IsMeridian ? basin.RingArea / toBasin.RingArea : 1;
                    var    v          = Viscosity * height;
                    var    vFromBasin = v;
                    double?vToBasin   = null;
                    if (v > 0)
                    {
                        if (basin.Depth.HasValue)
                        {
                            vFromBasin = Math.Min(basin.WaterHeight, v);
                            vToBasin   = vFromBasin * k;
                        }
                    }
                    else
                    {
                        // todo test this
                        if (toBasin.Depth.HasValue)
                        {
                            vToBasin   = -Math.Min(toBasin.WaterHeight, -v * k);
                            vFromBasin = vToBasin.Value / k;
                        }
                    }
                    if (!vToBasin.HasValue)
                    {
                        vToBasin = v * k;
                    }

                    if (Math.Abs(vFromBasin) > 0)
                    {
                        toBasin.WaterIn(vToBasin.Value, from);

                        // water out source basin
                        basin.WaterIn(-vFromBasin, to);
                        return(vFromBasin);
                    }
                }
            }
            return(0);
        }
예제 #3
0
        /// <param name="a">perpendicular to AxisOrRotation</param>
        /// <param name="aTraverse"></param>
        /// <returns>aMeridian,  directed to equator of OZ</returns>
        public static double Centrifugal(BasinBase basin, out double a, out double aTraverse, out double aVertical)
        {
            aTraverse = 0;
            if (AxisOfRotation == Basin3.Oz)
            {
                a         = Centrifugal(basin.r * Math.Cos(basin.Varphi));
                aVertical = a * Math.Sin(basin.Theta);
                return(a * Math.Abs(Math.Cos(basin.Theta)));
            }

            var b             = (Basin3)basin;
            var axisEnd       = AxisOfRotation.ToPoint3D();
            var axisOrtohonal = new Line3D(Basin3.O3, axisEnd).LineTo(b.Q3, false);

            a = Centrifugal(axisOrtohonal.Length);

            return(CentrifugalByMatrix(b, a, axisOrtohonal, out aTraverse, out aVertical));
            //return CentrifugalByDotProduct(b, a, axisEnd, out aTraverse);
        }
예제 #4
0
        /// <summary>
        /// todo do not use DistanceTo, return Point2D instead of double
        /// be careful with points
        /// </summary>
        public override double Intersect(BasinBase otherBasin)
        {
            var other = (MeridianBase)otherBasin;

            return(KQ.IntersectWith(OQ(other.Q)).Value.DistanceTo(other.Q));
        }
예제 #5
0
 public override double Intersect(BasinBase otherBasin)
 {
     return(Math.Tan(Delta_g_meridian) * lQn2);
 }
예제 #6
0
        public static double Centrifugal(BasinBase basin)
        {
            double a, aTraverse, aVertical;

            return(Centrifugal(basin, out a, out aTraverse, out aVertical));
        }