How to calculate a transformed conic curve?

31 Views Asked by At

The origin question came from I want to move from A to B with a conic curve, and its model was like this:

Say We have a curve transformed from $y=x^2$ (just with rotation and movement)

enter image description here

And is there a transform that could let me calculate the samples of the curve?

in another word I want samples serial to be like this [(5.5,-0.5), ... (1,2)]

2

There are 2 best solutions below

1
On BEST ANSWER

Let's start with a parametric form of the curve: $$ \left\{ \begin{array}{ccc} x &=& t \\ y &=& t^2 \end{array} \right. $$ When $t$ gets some range, it plots the usual graph of $y= x^2$. Now we must rotate it about the $z$-axis, with some angle $\theta$: $$ \left[ \begin{array}{c} x_{\text{rotated}} \\ y_{\text{rotated}} \end{array} \right] = \left[ \begin{array}{cc} \cos{\theta} & -\sin{\theta} \\ \sin{\theta} & \cos{\theta} \end{array} \right] \left[ \begin{array}{c} x \\ y \end{array} \right] = \left[ \begin{array}{c} \cos{\theta} t - \sin{\theta}t^2 \\ \sin{\theta}t + \cos{\theta}t^2 \end{array} \right] $$ So if you choose $\theta$, this set of points represents the rotated curve. The only thing left is to displace the curve by a desired amount, let's say $$ \left[ \begin{array}{c} x_{\text{final}} \\ y_{\text{final}} \end{array} \right] = \left[ \begin{array}{c} x_{\text{rotated}} \\ y_{\text{rotated}} \end{array} \right] +\left[ \begin{array}{c} x_{\text{displacement}} \\ y_{\text{displacement}} \end{array} \right] = \left[ \begin{array}{c} \cos{\theta} t - \sin{\theta}t^2 + x_{\text{displacement}} \\ \sin{\theta}t + \cos{\theta}t^2 + y_{\text{displacement}} \end{array} \right] $$ And we're done.

0
On

If I correctly understood what you are asking, that you want to rotate and translate a parabola, one way to do it is to use a rotation matrix. You can consider the coordinates $(x, y) $ as the vectors $ \begin{pmatrix} x \\ y \end{pmatrix} \in \mathbb{R}^2 $, and the linear transformation in the standard ordered bases of $ \mathbb{R}^2 $ and $ \mathbb{R}^2 $ given by $ r_\theta : \mathbb{R}^2 \to \mathbb{R}^2, \begin{pmatrix} x \\ y \end{pmatrix} \mapsto \begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} $. You can then move it around. I think the rest immediately follows.