Calculate Coordinates on Arc, Based on Time of Day

368 Views Asked by At

Hopefully someone can help me out with this.

I'm trying to calculate the position of a point on an arc, based on a percentage of distance along the circumference (% time of day). Sidenote - I'm writing a computer program to execute this, it's just the math that's stopping me!

I know the length of the chord, the height of the saggita, and the coordinates of the circle. I've attached an image as a diagram to explain this.

Based on the time of day, from $6$A.M $(0,0)$ to $6$P.M $(1400,0)$, where will the point on the arc be? Given that $12$P.M the arc will be at coordinates $(700,500)$.

Saggita = $500$, Chord = $1400$

enter image description here

Another image, with the things I know and don't, also better illustrating the problem I'm trying to solve.

The Problem Illustrated

2

There are 2 best solutions below

2
On BEST ANSWER

EDIT (If Curve is a Circle):
An edit must be made if the curve is a shifted down semicircle. Lets assume it is. Then to find its equation we will fit an equation of the form $$y=\sqrt{R^2-(x-700)^2}+k$$ to the points $(0,0), (700,500),$ and $(1400,0)$. That requires solving a system of equations, but I'll just skip to the fact that the equation for the semi-circle is $$y=\sqrt{740^2-(x-700)^2}-240$$ Next we want to find what the arc length is from $x=0$ to $1400$. Using calculus, $$S_1=\int_{0}^{1400}\sqrt{1+\left(\frac{x-700}{\sqrt{740^2-(x-700)^2}}\right)^2}\text{d}x=1480\arcsin\left(\frac{35}{37}\right)\approx 1835.9$$ Having that done we also want the arc length from $x=1400$ to $1440$, $S_2$, which can be done using geometry and is $$S_2=\frac{740\pi-S_1}{2}\approx 244.439$$ Now we want to find, based on $m$ minutes that have passed since $6$ A.M. what the interior angle $\theta$ is so that we can use $\sin$ and $\cos$ for the coordinates. Using geometry we can get that the central angle formed by the sun and the point $(1440,-240)$ is given by $$\theta=\frac{S_1-\frac{S_1\cdot m}{720}+S_2}{R}\approx \frac{1497844.08-1835.9m}{532800}$$ Then having computed $\theta$ given an $m$, the coordinates of the sun are just $$(740\cos\theta + 700, 740\sin\theta-240)$$ In conclusion using $m$ just find $\theta$ and plug it into the parametrized coordinates. Here's a Desmos graph where you can change the value of $m$ and watch the coordinate in red (the sun) move along the circle.

If Curve is an Ellipse
What we have here is half an ellipse. The function for that half ellipse is $$y=500\sqrt{1-\left(\frac{x-700}{700}\right)^2}$$ Now we need to find the length of the arc, and for that we will use some calculus. The arc length, $S$, is given by in this case, $$S=\int_{0}^{1400}\sqrt{1+\left(\frac{5(x-700)}{7\sqrt{-x(x-1400)}}\right)^2}\text{d}x$$ $$=\int_{0}^{1400}\sqrt{1-\frac{25(x-700)^2}{49x(x-1400)}}\text{d}x=1898.07$$ Using that, there's a few things that can be said. Let $m$ be the minutes that have passed since 6 A.M., then the arc length that has been covered is given by $$S_m=\frac{1898.07m}{720}$$ Using that a the following can be done: Given a time compute $S_m$, the amount of arclength that has been covered. Then decide on a threshold $\epsilon>0$, and have you're computer test values until it finds a value $x_0$ such that $$\left|S_m - \int_{0}^{x_0}\sqrt{1-\frac{25(x-700)^2}{49x(x-1400)}}\text{d}x\right|\le \epsilon$$ Then the coordinates of the sun will be $$(x_0,y(x_0))$$ where $y$ is as defined above.

I'll work on thinking of a more efficient way to approximate the coordinates, but as of now that's the best I can think of.

2
On

Here is a general solution for the situation you describe, pictured below. The question states that the three given points (which I'll call $A,B,C$) are on a circle, and indeed these points determine a unique $\color{blue}{circle}$. I consider the problem of finding where on this circle the sun will appear to be (as a function of time), as seen by someone located at the midpoint $O$ of line segment $AB$.

NB: $O$ is not the center of the blue circle, but is the center of a $\color{orange}{circle}$ around which the sun will appear (from $O$) to move at (approximately) constant speed. Consequently, the sun will appear to move at varying speeds around the blue circle.

  • $A=(0,0),\ B=(0,2a),\ C=(a,h)$ (Your question is the case $a=700, h=500$.)
  • $AB$ is a line segment of length $2a$ with midpoint $O$.
  • $C$ is the point at height $h$ on the perpendicular bisector of $AB$.
  • The orange circle has radius $a$ and is centered at $O$.
  • $P$ is the point on the orange circle such that $O$P is aligned with the sun.
  • The blue circle is the unique circle that passes through points $A,B,C$. Let $R$ denote its radius. (Note $R> a$ if $a>h$.)
  • $P'$ (whose coordinates we want to find) is the point on the blue circle such that $OP'$ is aligned with the sun.

enter image description here

Solution ...

  1. Let $O'$ be the center of the blue circle. By considering the right triangle $AOO'$, $$(R-h)^2 + a^2 = R^2\tag{1}$$ therefore $$R = \frac{a^2+h^2}{2h}\tag{2}$$

  2. With time $t$ measured in hours since midnight,$$\theta(t) = \frac{\pi}{12}t - \frac{\pi}{2}\quad(6\le t\le 18)\tag{3}$$ (To get this, set $\theta(t) = c_1 t + c_2$, then determine $c_1,c_2$ by requiring $\theta(6) = 0, \theta(18) = \pi$.)

  3. Let $(x_P,y_P)$ be the coordinates of point $P$. By simple trigonometry, $$\begin{align}x_P =& a(1-\cos\theta)\\ y_P =& a\sin\theta\end{align}\tag{4}$$

  4. Find the required coordinates $(x,y)$ of point $P'$ by solving two simultaneous equations: The line through $OP$ is described by the equation $$y=\begin{cases}\frac{y_P}{x_P-a}(x-a) && \text{if }x_P\neq a\\ h && \text{if }x_P = a\end{cases}\tag{5}$$ and the blue circle has equation $$(x-a)^2 + ((y+(R-h))^2 = R^2\tag{6}$$ Substituting $y$ from $(5)$ into $(6)$ and solving for $x$, $$x=\begin{cases} \frac{a-ST - \sqrt{(a-ST)^2 - (S^2+1)(a^2+T^2-R^2)}}{S^2+1} &&\text{if } \theta < {\pi\over 2} \\ a &&\text{if } \theta = {\pi\over 2}\\ \frac{a-ST + \sqrt{(a-ST)^2 - (S^2+1)(a^2+T^2-R^2)}}{S^2+1} &&\text{if } \theta > {\pi\over 2} \\ \end{cases}\tag{7}$$ where $$\begin{align} S =& \frac{y_P}{x_P-a}\\ T =& R-h -aS \end{align}\tag{8}$$


Summarizing: To find the coordinates $(x,y)$ of point $P'$, the steps are $$t \xrightarrow{Eq(3)}\theta\xrightarrow{Eq(4)}(x_P,y_P)\xrightarrow{Eqs(5,7,8)} (x,y).$$


Example ($a=700, h=500, R=740$, time = 9:37 AM) $$\begin{align} t &= 9 + 37/60 \approx 9.61666666666667\\ \theta &\approx 0.946841119206924\\ P(x_P,y_P) &\approx (291.025234053796, 568.101787375508)\\ P'(x,y) &\approx (389.286724718565,431.607966423778) \end{align}$$

Here's a picture for $120$ equally-spaced times ($\delta t = 6$ minutes) spanning the $12$-hour period:

enter image description here

NB: As point $P$ moves around the orange circle at constant speed, point $P'(x,y)$ moves around the blue circle at speeds that vary with time, moving faster near noon and slower near 6 AM and 6 PM. This shows up as a change in the spacing of the plotted points.