3
$\begingroup$

I try to find a way to calculate coordinates of a point nested on a circle inscribed in a square. The available variables, are: 1) side length of the square = 100; 2) circle radius = 50; 3) angle (a) = 45 degrees, but it can vary (e.g. 21, 15.3, etc.)

What I'm looking for in the situation described above are X2 x and y coordinates on the given square.

enter image description here

I'm out of ideas, so I'll be appreciate for any help.

$\endgroup$
2
$\begingroup$

put your square in a cartesian coordinate system an compute the equation of the incircle in the form
$(x-x_M)^2+(y-y_M)^2=R^2$
$M(x_M,y_M)$ is the middlepoint of the incircle with the coordinates $x_M,y_M$

$\endgroup$
9
$\begingroup$

Hope the following illustration helps:-enter image description here

$\endgroup$
1
$\begingroup$

If we choose as origin the bottom-left vertix, and call the radius with the letter $\ r$:

$\ X_{2}(c_{x},c_{y})\iff X_{2}(50+c,r-c)$, where $c=r \sin(45°)=\frac{r}{\sqrt2}$

$\endgroup$
1
$\begingroup$

Let the perpendicular from $X_2$ to $X_0X_1$ be $X$. Then $\cos a=X_0X/50$ and $\sin a=X_2X/50$. From the way you have defined the coordinates so that moving right increases the horizontal coordinate and moving down increases the vertical coordinate, the coordinates of $X_2$ are $$(50+50\cos a,50+50\sin a).$$

$\endgroup$
  • $\begingroup$ Please forgive my ignorance, but why is the Y coordinate not 50 - 50 sin a? $\endgroup$ – Upper Stage Sep 22 '14 at 16:06
1
$\begingroup$

(This may be using a sledgehammer to crack a nut...)

$X_2$ can be interpreted as a clockwise rotation of $X_1$ around $X_0$ with an angle of $a$.

This can be expressed as a rotation matrix:

$$ R(a)= \begin{bmatrix} +\cos a & -\sin a \\ +\sin a & +\cos a \\ \end{bmatrix} $$

If you multiply this matrix with a column vector, then the result is a clockwise (*) rotation of the vector by an angle $a$ around the origin $(0,0)$:

$$ \begin{bmatrix} +\cos a & -\sin a \\ +\sin a & +\cos a \\ \end{bmatrix}\begin{bmatrix} x \\ y \\ \end{bmatrix} = (x \cos a - y \sin a, x \sin a + y \cos a) $$

But we do not want to rotate around $(0,0)$ but $X_0$, so we need a coordinate transformation where $X_0$ corresponds to $(0,0)$: $$\hat X_1 = X_1-X_0 = (100,50) - (50,50) = (50,0)$$

Now we rotate $\hat X_1$ using the matrix above: $$\begin{align} \hat X_2 & = (\hat X_{1x} \cos 45° - \hat X_{1y} \sin 45°, \hat X_{1x} \sin 45° + \hat X_{1y} \cos 45°) \\ & = (50 \cos 45° - 0 \sin 45°, 50 \sin 45° + 0 \cos 45°) \\ & = (50 \cos 45°, 50 \sin 45°) \\ & \approx (35.36, 35.36) \end{align}$$

And reverse the coordinate transformation: $$X_2 = \hat X_2 + X_0 \approx (85.36, 85.36)$$

By the way: Using homogenous coordinates, we could even combine all of this into a single transformation matrix.

(*) In this example, it's a clockwise rotation because the coordinate system is left-handed. In a right-handed system, it would be a counterclockwise rotation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.