title: Keep Point(2) or Vector2(2) joined to Point(1) or Vector2(1)
body: <p>Imagine a segmented creature such as a centipede.  With control of the head segment, the body segments are attached to the previous body segment by a point.</p>
  
  <p>As the head moves (in the 8 cardinal/inter-cardinal directions for now) a point moves in relation to its rotation.</p>
  
  <pre><code>public static Vector2 RotatePoint(Vector2 pointToRotate, Vector2 centerOfRotation, float angleOfRotation)
  {
      Matrix rotationMatrix = Matrix.CreateRotationZ(angleOfRotation);
      return Vector2.Transform(pointToRotate - centerOfRotation, rotationMatrix);
  }
  </code></pre>
  
  <p>Was going to post a diagram here but you know...</p>
  
  <pre><code> center(2)      point(2)                      center(1)    point(1)
  
  
  
                                                       point(1)                    
  
                  point(2)    ^                                        |
                             / \                                       |
                              |                                        |
   center(2)                                           center(1)      \ /
                                                                       V
  </code></pre>
  
  <p>I have thought of using a rectangle property/field for the base sprite,</p>
  
  <pre><code>private Rectangle bounds = new Rectangle(-16, 16, 32, 32);
  </code></pre>
  
  <p>and checking that a predefined point within the body segment remains within the head sprite's bounds.<br>
  Though I am currently doing:</p>
  
  <pre><code>     private static void handleInput(GameTime gameTime)
      {
          Vector2 moveAngle = Vector2.Zero;
  
          moveAngle += handleKeyboardMovement(Keyboard.GetState()); // basic movement, combined to produce 8 angles
                                                                    // of movement
  
          if (moveAngle != Vector2.Zero)
          {
              moveAngle.Normalize();
              baseAngle = moveAngle;
          }
  
          BaseSprite.RotateTo(baseAngle);
  
          BaseSprite.LeftAnchor = RotatePoint(BaseSprite.LeftAnchor,
   BaseSprite.RelativeCenter, BaseSprite.Rotation); // call RotatePoint method
  
          BaseSprite.LeftRect = new Rectangle((int)BaseSprite.LeftAnchor.X - 1,
   (int)BaseSprite.LeftAnchor.Y - 1, 2, 2); 
   // All segments use a field/property that is a point which is suppose to rotate around the center
          // point of the sprite (left point is (-16,0) right is (16,0) initially
          // I then create a rectangle derived from that point to make use of the .Intersets method of the
          // Rectangle class
  
          BodySegmentOne.RightRect = BaseSprite.LeftRect; // make sure segments are connected?
  
          BaseSprite.Velocity = moveAngle * wormSpeed;
  
          //BodySegmentOne.RightAnchor = BaseSprite.LeftAnchor;
  
          if (BodySegmentOne.RightRect.Intersects(BaseSprite.LeftRect)) // as long as there two rects occupy the 
          {                                                             // same space move segment with head
  
              BodySegmentOne.Velocity = BaseSprite.Velocity;
          }
  
      }
  </code></pre>
  
  <p>As it stands now, the segment moves with head but in a parallel fashion.  I would like to get a more nuanced movement of the segment as it is being dragged by the head. </p>
  
  <p>I understand that the coding of such movement will be much more involved than what I have here.  Some hints or directions as to how I should look at this problem would be greatly appreciated.</p>