示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OsmSharp.Math.Primitives.RectangleF2D"/> class.
        /// </summary>
        /// <param name="x">The x coordinate of the bottom-left corner.</param>
        /// <param name="y">The y coordinate of the bottom-left corner.</param>
        /// <param name="width">Width.</param>
        /// <param name="height">Height.</param>
        /// <param name="angleY">The angle relative to the y-axis.</param>
        public RectangleF2D(double x, double y, double width, double height, Degree angleY)
        {
            _bottomLeft = new PointF2D(x, y);
            VectorF2D directionY = VectorF2D.FromAngleY(angleY);

            _vectorY = directionY * height;
            _vectorX = directionY.Rotate90(true) * width;
        }
示例#2
0
        public RectangleF2D(double x, double y, double width, double height, Degree angleY)
        {
            this._bottomLeft = new PointF2D(x, y);
            VectorF2D vectorF2D = VectorF2D.FromAngleY(angleY);

            this._vectorY = vectorF2D * height;
            this._vectorX = vectorF2D.Rotate90(true) * width;
        }
示例#3
0
 /// <summary>
 /// Creates a new RectangleF2D from given bounds, center and angle.
 /// </summary>
 /// <param name="centerX"></param>
 /// <param name="centerY"></param>
 /// <param name="width">Width.</param>
 /// <param name="height">Height.</param>
 /// <param name="angleY">The angle.</param>
 /// <returns></returns>
 public static RectangleF2D FromBoundsAndCenter(double width, double height, double centerX, double centerY, Degree angleY)
 {
     return(RectangleF2D.FromBoundsAndCenter(width, height, centerX, centerY, VectorF2D.FromAngleY(angleY)));
 }