Beispiel #1
0
        public Vector2(IPointCyl ptIn)
        {
            x = (double)(ptIn.R * Math.Cos(ptIn.ThetaRad));
            y = (double)(ptIn.R * Math.Sin(ptIn.ThetaRad));

            Col = ptIn.Col;
        }
Beispiel #2
0
        public double DistanceTo(IPointCyl p2)
        {
            IVector3 p1c = new Vector3(this);
            IVector3 p2c = new Vector3(p2);

            return(p1c.DistanceTo(p2c));
        }
Beispiel #3
0
        public IPointCyl InterpolateR(double radius, IPointCyl ptLow, IPointCyl ptHigh)
        {
            try
            {
                var dr = ptHigh.R - ptLow.R;

                var dz = ptHigh.Z - ptLow.Z;
                var dt = ptHigh.ThetaRad - ptLow.ThetaRad;
                if (dr == 0)
                {
                    return(ptLow);
                }
                else
                {
                    var proportion = (radius - ptLow.R) / dr;
                    var z          = (proportion * dz) + ptLow.Z;
                    var t          = (proportion * dt) + ptLow.ThetaRad;
                    return(new PointCyl(radius, t, z));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #4
0
 public Vector3(IPointCyl ptIn)
 {
     X   = (double)(ptIn.R * Math.Cos(ptIn.ThetaRad));
     Y   = (double)(ptIn.R * Math.Sin(ptIn.ThetaRad));
     Z   = (double)(ptIn.Z);
     Col = ptIn.Col;
 }
        public void PointCyl_translate_returnPt()
        {
            IPointCyl pt    = new PointCyl(1, Math.PI, 1);
            IPointCyl ptOut = pt.Translate(new Vector3(1, 1, 1));

            Assert.AreEqual(2d, ptOut.Z, .001);
            Assert.AreEqual(pt.R, ptOut.R, .001);
            Assert.AreEqual(Math.PI / 2, ptOut.ThetaRad, .001);
        }
Beispiel #6
0
        public Line3(IPointCyl pt1, IPointCyl pt2)
        {
            try
            {
                double x1 = pt1.R * Math.Cos(pt1.ThetaRad);
                double y1 = pt1.R * Math.Sin(pt1.ThetaRad);
                double z1 = pt1.Z;
                double x2 = pt2.R * Math.Cos(pt2.ThetaRad);
                double y2 = pt2.R * Math.Sin(pt2.ThetaRad);
                double z2 = pt2.Z;

                Col    = pt1.Col;
                Point1 = new Vector3(x1, y1, z1);
                Point2 = new Vector3(x2, y2, z2);
                Init();
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #7
0
 public bool Remove(IPointCyl item)
 {
     return(data.Remove(item));
 }
Beispiel #8
0
 public bool Contains(IPointCyl item)
 {
     return(data.Contains(item));
 }
Beispiel #9
0
 public void Add(IPointCyl item)
 {
     data.Add(item);
 }
Beispiel #10
0
 public void Insert(int index, IPointCyl item)
 {
     data.Insert(index, item);
 }
Beispiel #11
0
 public int IndexOf(IPointCyl item)
 {
     return(data.IndexOf(item));
 }