Geometry – Transforming an Arc-Based Point with Other Points Considering Angle

geometry

If have a point on an arc and other points related to it. I now want to move the point on the arc to a given target and rotate everything so that the arc-based-point has a vertical angle as the new position (like the if the arc-center would now be just below (on y-axis) the target.

Example: I have an arc-center $R(0;-233.7)$, radius $250$ and arc-point $P(9.9;16.1)$. That point is at about $2.27°$ of the arc. The other point is $Q(0;0)$, so $P$ and $Q$ are a "shape". Now if I move $P$ to target positon $T(0;16.3)$ in a way so that the midpoint $R$ would be on the y-axis, where is $Q$ in that case? This is not just vector movement but we need to rotate as well which gives me headaches.


Edit: Maybe the single problem is easier in the context. The complete problem is that I have a shape defined by 3 arcs. Here you see it with three different colors for each arc (the blue one is quite small at $0°$ and $90°$. I can calculate the shapepoints. In fact I am calculating a quarter of the shape and mirror the remaining parts.

Shape of three arcs

For each of the points I calculate I want to know where the midpoint (of the shape) is if I put the point to a targetpoint where it is not only moved to but the shape must be aligned at the target point so that the tangent on the point (based on the initial arc) is parallel to x-axis like shown here:

Shape rotated to the target point

As you can see it is not as easy as the midpoint is always directly below the target point, it needs to be moved so the correct angle is set.

I know each shapepoint $P$, the radii $r1$, $r2$ and $r3$, the arc lengths $s1$, $s2$, $s3$, the angle where each arc starts and ends, The width $A$ and height $B$ of the shape.


2nd edit: What I am currently doing:

I start at the top (middle of green part) at 90° with the first point there, going clockwise. I take the counter-angle of the current angle where the point was generated $\alpha = 90° – currentAngle$. At the beginning the midpoint of the shape is at $SM(0,0)$. I know the current arc-center $R_1$ and $r_1$ which defined the shape point.

So my current rotation center $RC$ is $R_1$. I just rotate $SM$ by $\alpha$ around $RC$.

This works great until I come to the point where the shape point was generated by the next arc defined by $R_2$ and $r_2$. When it comes to that point, I rotate $R_1$, $R_2$, $R_3$ as well around the (old) $RC$. Then I switch $RC$ to the rotated $R_2'$. $\alpha$ will now be decreased by the alread done angle, so here $\alpha$ becomes 0° again and I start to rotate again.

From here on, the outcome starts to get wrong. I also recognized that I am rotating around a $RC$ whose x-coordinate is no longer $0.00$ so it is not directly below my target position anymore.

Best Answer

where is $Q$ in that case?

When you move $P$ to $T$, then $R$ moves to $R'$ where $\vec{RR'}=\vec{PT}$ implies $R'_x=R_x+T_x-P_x=-9.9$ and $R'_y=R_y+T_y-P_y=-233.5$.

The equation of the circle whose center is $R'$ with radius $250$ is given by $$(x+9.9)^2+(y+233.5)^2=250^2$$

So, the slope of the tangent line at $T$ is given by $$\frac{-T_x-9.9}{T_y+233.5}=-\frac{99}{2498}$$

So, the angle $\alpha$ between the tangent line and the $x$-axis is given by $$\alpha\approx 177.7304^\circ$$

Therefore, we can get $Q''$ by rotating $Q'(-9.9,0.2)$ by $180^\circ-177.7304^\circ=2.2696^\circ$ around $T$.

Since $$\begin{pmatrix}Q''_x-T_x\\Q''_y-T_y\end{pmatrix}=\begin{pmatrix} \cos(2.2696^\circ) & -\sin(2.2696^\circ) \\ \sin(2.2696^\circ) & \cos(2.2696^\circ) \end{pmatrix}\begin{pmatrix} Q'_x-T_x \\ Q'_y-T_y\end{pmatrix}$$ we have $$\begin{align}Q''_x&=T_x+(Q'_x-T_x)\cos(2.2696^\circ)-(Q'_y-T_y)\sin(2.2696^\circ) \\\\&\approx -9.2547\end{align}$$ and $$\begin{align}Q''_y&=T_y+(Q'_x-T_x)\sin(2.2696^\circ)+(Q'_y-T_y)\cos(2.2696^\circ) \\\\&\approx -0.1794\end{align}$$


Added 1 :

May I ask to elaborate how $\alpha$ is calculated and how did you calculate $Q′$?

Since $-\frac{99}{2498}$ is negative, we see that $\alpha$ is obtuse. So, $\alpha$ (in radians) is given by $$\arctan\bigg(-\frac{99}{2498}\bigg)+\pi$$ (The reason why we add $\pi$ is that $-\frac{\pi}{2}\lt \arctan(x)\lt\frac{\pi}{2}$. See here.)

According to WolframAlpha, $$\arctan\bigg(-\frac{99}{2498}\bigg)+\pi\approx 3.10198$$

So, $\alpha$ (in degrees) is given by $$3.10198\times \frac{180}{\pi}\approx 177.7304$$


Since $\vec{QQ'}=\vec{PT}$, we have $$Q'_x=Q_x+T_x-P_x=-9.9$$ $$Q'_y=Q_y+T_y-P_y=0.2$$


Added 2 :

Let us prove the following claim.

Claim : Let $A$ be a point on the circle whose center is $B$ with radius $r$. When we move everything such that $A$ moves to $C$, the point $B$ moves to $B'$, and the point $D$ moves to $D'$. Moreover, when we rotate everything such that the tangent line at $C$ is parallel to the $x$-axis and the circle is below the tangent line, the point $D'$ moves to $D''$. Then, $$D''_x=C_x+(D_x-A_x)\cos\beta-(D_y-A_y)\sin\beta$$ $$D''_y=C_y+(D_x-A_x)\sin\beta+(D_y-A_y)\cos\beta$$ where $\beta\ $ ($\color{red}{\text{in radians}}$, not in degrees) is given by $$\beta=\begin{cases}\dfrac{\pi}{2}&\text{if $A_y=B_y$ and $A_x\gt B_x$} \\\\\dfrac{3\pi}{2}&\text{if $A_y=B_y$ and $A_x\lt B_x$} \\\\ 0&\text{if $A_x=B_x$ and $A_y\gt B_y$} \\\\ \pi&\text{if $A_x=B_x$ and $A_y\lt B_y$} \\\\ -\arctan\bigg(\dfrac{B_x-A_x}{A_y-B_y}\bigg)&\text{if $B_x\lt A_x$ and $A_y\gt B_y$} \\\\ \pi-\arctan\bigg(\dfrac{B_x-A_x}{A_y-B_y}\bigg)&\text{if $B_x\not= A_x$ and $A_y\lt B_y$} \\\\ 2\pi-\arctan\bigg(\dfrac{B_x-A_x}{A_y-B_y}\bigg)&\text{if $B_x\gt A_x$ and $A_y\gt B_y$}\end{cases}$$

Proof :

Since $\vec{DD'}=\vec{AC}$, we have $D'_x=D_x+C_x-A_x$ and $D'_y=D_y+C_y-A_y$.

Since $\vec{BB'}=\vec{AC}$, we have $B'_x=B_x+C_x-A_x$ and $B'_y=B_y+C_y-A_y$.

The equation of the circle whose center is $B'$ with radius $r$ is given by $$(x-B'_x)^2+(y-B'_y)^2=r^2$$

If $C_y=B'_y$ and $C_x\gt B'_x$, then we can get $D''$ by rotating $D'$ by $\frac{\pi}{2}$ [rad] around $C$.

If $C_y=B'_y$ and $C_x\lt B'_x$, then we can get $D''$ by rotating $D'$ by $\frac{3\pi}{2}$ [rad] around $C$.

In the following, $C_y\not=B'_y$.

The slope of the tangent line at $C$ is given by $$s:=\frac{-C_x+B'_x}{C_y-B'_y}$$

  • If $s=0$ and $C_y\gt B'_y$, then we can get $D''$ by rotating $D'$ by $0$ [rad] around $C$.

  • If $s=0$ and $C_y\lt B'_y$, then we can get $D''$ by rotating $D'$ by $\pi$ [rad] around $C$.

  • If $s\lt 0$ and $C_y\gt B'_y$, then we can get $D''$ by rotating $D'$ by $-\arctan(s)$ [rad] around $C$.

  • If $s\lt 0$ and $C_y\lt B'_y$, then we can get $D''$ by rotating $D'$ by $\pi-\arctan(s)$ [rad] around $C$.

  • If $s\gt 0$ and $C_y\gt B'_y$, then we can get $D''$ by rotating $D'$ by $2\pi-\arctan(s)$ [rad] around $C$.

  • If $s\gt 0$ and $C_y\lt B'_y$, then we can get $D''$ by rotating $D'$ by $\pi-\arctan(s)$ [rad] around $C$.

Let $\beta$ [rad] be the angle by which we rotate everything.

Since $$\begin{pmatrix}D''_x-C_x\\D''_y-C_y\end{pmatrix}=\begin{pmatrix} \cos\beta & -\sin\beta \\ \sin\beta & \cos\beta \end{pmatrix}\begin{pmatrix} D'_x-C_x \\ D'_y-C_y\end{pmatrix}$$ we have $$D''_x=C_x+(D'_x-C_x)\cos\beta-(D'_y-C_y)\sin\beta$$ and $$D''_y=C_y+(D'_x-C_x)\sin\beta+(D'_y-C_y)\cos\beta$$

Related Question