title: Adjust Cylinder transform to match 2 given points
body: <p>Suppose I have a cylinder (of height 2, length and width 1) that contains two children <strong>top</strong> and <strong>bottom</strong> and 2 given points in space <strong>p1</strong> and <strong>p2</strong>, just like this:</p>
  <p><a href="https://i.stack.imgur.com/a70C3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a70C3.png" alt="enter image description here" /></a></p>
  <p>How can I evaluate the rotation of this cylinder so that <strong>top</strong> go to <strong>p1</strong>, <strong>bottom</strong> go to <strong>p2</strong> and the cylinder align correctly with the points? This is the result I want:</p>
  <p><a href="https://i.stack.imgur.com/aSxoU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aSxoU.png" alt="enter image description here" /></a></p>
  <hr />
  <p>The final position of the cylinder should be (p1 + p2)/2 and the y-scale should be (p1 - p2).magnitude / 2, since the cylinder has natural height of 2.</p>