예제 #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
파일: Vector.cs 프로젝트: catashd/NetVecCad
 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);
        }