/// <summary>
        /// Scales the segment from the provided reference point.
        /// </summary>
        /// <param name="scale">The amount to scale relative to the reference point.</param>
        /// <param name="referencePoint">The reference point.</param>
        /// <returns>IPathSegment.</returns>
        public virtual IPathSegment ScaleFromPoint(double scale, CartesianCoordinate referencePoint)
        {
            CartesianOffset offsetJ = scale * (J.OffsetFrom(referencePoint));
            CartesianOffset offsetI = scale * (I.OffsetFrom(referencePoint));

            return(new LineSegment(
                       referencePoint + offsetI.ToCartesianCoordinate(),
                       referencePoint + offsetJ.ToCartesianCoordinate()));
        }
Exemple #2
0
        public static void ToCartesianCoordinate_Returns_Cartesian_Coordinate_Offset_from_Orgin(
            double xI, double yI, double xJ, double yJ,
            double xNew, double yNew)
        {
            CartesianOffset offset = new CartesianOffset(
                new CartesianCoordinate(xI, yI),
                new CartesianCoordinate(xJ, yJ));

            CartesianCoordinate newCoordinate = offset.ToCartesianCoordinate();

            Assert.AreEqual(xNew, newCoordinate.X, Tolerance);
            Assert.AreEqual(yNew, newCoordinate.Y, Tolerance);
        }
Exemple #3
0
 /// <summary>
 /// The component first differentical as a function of the supplied parameter.
 /// </summary>
 /// <param name="parameter">The parameter, such as relative position between 0 &amp; 1, or the angle in radians.</param>
 /// <returns>System.Double.</returns>
 public override CartesianCoordinate PrimeByParameter(double parameter)
 {
     return(_offset.ToCartesianCoordinate());
 }