Пример #1
0
        public Vector rotateCloneAboutZ(Angle rotation)
        {
            var newVec = new Vector(this); //(Vector) this.Clone();

            newVec.rotateAboutZ(rotation);
            return(newVec);
        }
Пример #2
0
        public void setFrom_2dOnly(Point Center, Double totalWidth, Double totalHeight, Angle rotation)
        { // yea, the 3d version will require a quaternion.  Implement 3d maybe in 2015.
            Vector topRight    = new Vector(totalWidth / 2.0, totalHeight / 2.0, null);
            var    bottomRight = new Vector(topRight); bottomRight.flipAboutX_2d();
            var    topLeft     = new Vector(topRight); topLeft.flipAboutY_2d();
            var    bottomLeft  = new Vector(topRight); bottomLeft.ScaleBy(-1.0, -1.0, null);

            topRight.rotateAboutZ(rotation);
            bottomRight.rotateAboutZ(rotation);
            topLeft.rotateAboutZ(rotation);
            bottomLeft.rotateAboutZ(rotation);

            this.isInitialized = false;
            this.expandByPoint(Center + topRight);
            this.expandByPoint(Center + topLeft);
            this.expandByPoint(Center + bottomLeft);
            this.expandByPoint(Center + bottomRight);
        }
Пример #3
0
 public Vector rotateCloneAboutZ(Angle rotation)
 {
     var newVec = new Vector(this); //(Vector) this.Clone();
      newVec.rotateAboutZ(rotation);
      return newVec;
 }
Пример #4
0
        public void setFrom_2dOnly(Point Center, Double totalWidth, Double totalHeight, Angle rotation)
        {
            // yea, the 3d version will require a quaternion.  Implement 3d maybe in 2015.
             Vector topRight = new Vector(totalWidth / 2.0, totalHeight / 2.0, null);
             var bottomRight = new Vector(topRight); bottomRight.flipAboutX_2d();
             var topLeft = new Vector(topRight); topLeft.flipAboutY_2d();
             var bottomLeft = new Vector(topRight); bottomLeft.ScaleBy(-1.0, -1.0, null);

             topRight.rotateAboutZ(rotation);
             bottomRight.rotateAboutZ(rotation);
             topLeft.rotateAboutZ(rotation);
             bottomLeft.rotateAboutZ(rotation);

             this.isInitialized = false;
             this.expandByPoint(Center + topRight);
             this.expandByPoint(Center + topLeft);
             this.expandByPoint(Center + bottomLeft);
             this.expandByPoint(Center + bottomRight);
        }