Пример #1
0
        /// <summary>
        /// Mirrors the specified coordinate about the specified line.
        /// </summary>
        /// <param name="coordinate">The coordinate.</param>
        /// <param name="referenceLine">The reference line.</param>
        /// <returns>CartesianCoordinate.</returns>
        public static CartesianCoordinate MirrorAboutLine(
            CartesianCoordinate coordinate,
            LinearCurve referenceLine)
        {
            CartesianCoordinate reflectionLinePoint = referenceLine.CoordinateOfPerpendicularProjection(coordinate);
            CartesianOffset     deltaReflection     = 2 * reflectionLinePoint.OffsetFrom(coordinate);

            return(coordinate + deltaReflection);
        }
Пример #2
0
        /// <summary>
        /// Skews the specified coordinate to the skewing of a containing box.
        /// </summary>
        /// <param name="coordinate">The coordinate.</param>
        /// <param name="stationaryReferencePoint">The stationary reference point of the skew box.</param>
        /// <param name="skewingReferencePoint">The skewing reference point of the skew box.</param>
        /// <param name="magnitude">The magnitude to skew along the x-axis and y-axis.</param>
        /// <returns>CartesianCoordinate.</returns>
        public static CartesianCoordinate SkewWithinBox(
            CartesianCoordinate coordinate,
            CartesianCoordinate stationaryReferencePoint,
            CartesianCoordinate skewingReferencePoint,
            CartesianOffset magnitude)
        {
            CartesianOffset skewBoxOffset = skewingReferencePoint.OffsetFrom(stationaryReferencePoint);
            double          lambdaX       = magnitude.X() / skewBoxOffset.Y();
            double          lambdaY       = magnitude.Y() / skewBoxOffset.X();

            return(Skew(coordinate, lambdaX, lambdaY));
        }
Пример #3
0
 /// <summary>
 /// Skews the specified coordinate about the origin.
 /// </summary>
 /// <param name="coordinate">The coordinate.</param>
 /// <param name="lambda">The magnitude to skew along the x-axis and y-axis.</param>
 /// <returns>CartesianCoordinate.</returns>
 public static CartesianCoordinate Skew(CartesianCoordinate coordinate, CartesianOffset lambda)
 {
     return(Skew(coordinate, lambda.X(), lambda.Y()));
 }