public Vector2(IPointCyl ptIn) { x = (double)(ptIn.R * Math.Cos(ptIn.ThetaRad)); y = (double)(ptIn.R * Math.Sin(ptIn.ThetaRad)); Col = ptIn.Col; }
public double DistanceTo(IPointCyl p2) { IVector3 p1c = new Vector3(this); IVector3 p2c = new Vector3(p2); return(p1c.DistanceTo(p2c)); }
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; } }
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); }
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; } }
public bool Remove(IPointCyl item) { return(data.Remove(item)); }
public bool Contains(IPointCyl item) { return(data.Contains(item)); }
public void Add(IPointCyl item) { data.Add(item); }
public void Insert(int index, IPointCyl item) { data.Insert(index, item); }
public int IndexOf(IPointCyl item) { return(data.IndexOf(item)); }