Example #1
0
        internal Point3Dmm ShiftTo(Point3Dmm target, double percentage)
        {
            var dx = target.X - X;
            var dy = target.Y - Y;
            var dz = target.Z - Z;

            return(new Point3Dmm(X + dx * percentage, Y + dy * percentage, Z + dz * percentage));
        }
Example #2
0
        /// <summary>
        /// Squared euclidian distance to given point
        /// </summary>
        public double DistanceSquaredTo(Point3Dmm point)
        {
            var diffZ = Z - point.Z;
            var diffX = X - point.X;
            var diffY = Y - point.Y;

            return(1.0 * diffZ * diffZ + 1.0 * diffX * diffX + 1.0 * diffY * diffY);
        }
Example #3
0
 public static Point3D As3D(this Point3Dmm point)
 {
     return(new Point3D(point.X, point.Y, point.Z));
 }
Example #4
0
 public static Point3Dstep As3Dstep(this Point3Dmm point)
 {
     return(new Point3Dstep(mmToStep(point.X), mmToStep(point.Y), mmToStep(point.Z)));
 }
Example #5
0
 /// <summary>
 /// Euclidian distance to given point.
 /// </summary>
 public double DistanceTo(Point3Dmm point)
 {
     return(Math.Sqrt(DistanceSquaredTo(point)));
 }