Page 1 of 1

[Solved] Astronomy binary star chart

Posted: Tue Feb 25, 2025 2:10 pm
by marty-0750
How do we plot the orbit of a binary star in Calc. The result should be an ellipse centered on the x/y axis

We are given a table of the:

Position-angle (PA) 0-360 degrees

Distance from the center or the separation (SEP) which is the radius vector.

Should look something like this:
ophiuchi.jpg
ophiuchi.jpg (18 KiB) Viewed 4835 times

Here is a sample table for part of an orbit.

Code: Select all

Alpha Centauri
 YEAR ,   PA,  SEP
 2025 ,  9.1,  8.8
 2026 , 11.8,  9.4
 2027 , 14.2,  9.8
 2028 , 16.4, 10.2
 2029 , 18.5, 10.4
 2030 , 20.5, 10.5
 2031 , 22.6, 10.3
 2032 , 24.8,  9.8
 2033 , 27.3,  9.0
 2034 , 30.5,  7.8
 2035 , 35.0,  6.3
 2036 , 42.9,  4.5
 2037 , 61.9,  2.6
 2038 ,119.5,  1.7
 2039 ,168.2,  3.0
 2040 ,183.6,  4.9
 2041 ,190.3,  6.8
 2042 ,194.1,  8.6
 2043 ,196.6, 10.3
 2044 ,198.4, 11.9
 2045 ,199.8, 13.2
 2046 ,201.0, 14.5
 2047 ,201.9, 15.6
 2048 ,202.8, 16.6
 2049 ,203.6, 17.5
 2050 ,204.3, 18.3
 2051 ,204.9, 19.0
 2052 ,205.5, 19.6
 2053 ,206.0, 20.1
 2054 ,206.6, 20.6
 2055 ,207.1, 21.0
 2056 ,207.6, 21.2
 2057 ,208.1, 21.5

Re: Astronomy binary star plot - how?

Posted: Tue Feb 25, 2025 3:13 pm
by FJCC
Well, off the top of my head, you have tan(PA) = y/x and SEP^2 = x^2 + y^2. You should be able to solve for x and y and plot the results.

Re: Astronomy binary star plot - how?

Posted: Tue Feb 25, 2025 3:35 pm
by floris v
Like x = SEP*cos (PA) and y = SEP*sin(PA), convert PA to radians.

Re: Astronomy binary star plot - how?

Posted: Tue Feb 25, 2025 7:06 pm
by Lupp
I found the time to adapt an old sheet of mine to this example.
It uses Option VBAsupport 1 to simplify passing of parameters, and will therefore only work under (not too old) LibreOffice.
Making it independent of VBAsupport isn't difficult, however.
nextPolyLine.ods
(58.53 KiB) Downloaded 102 times

Re: Astronomy binary star plot - how?

Posted: Wed Feb 26, 2025 11:08 am
by marty-0750
Neat polylines!

Thankyou for the tips

Now that I have applied the conversion to the circular plot I get the ellipse required and it matches the published ones. The graph however needs to be rotated 90 degrees clockwise to conform with astronomical convention as I attempted on the right. That is,north-down and east-left. I rotated the graph in this respect along with the axes labels but the title stubbornly remains upright on the right. Any tips?

Although one can hover the cursor over a data point and peek at the value, I would rather have every 5th (or so) data point labeled with the year, again as in the astronomical convention. How can I do this?
AlphaCent spreadsheet.jpg
AlphaCent spreadsheet.jpg (105.36 KiB) Viewed 4793 times

Re: Astronomy binary star plot - how?

Posted: Wed Feb 26, 2025 1:41 pm
by Lupp
PLEASE, attach "the real thing" (.ods file here) instead of pasting an image.

Re: Astronomy binary star plot - how?

Posted: Wed Feb 26, 2025 3:39 pm
by Hagar Delest
marty-0750 wrote: Wed Feb 26, 2025 11:08 am I would rather have every 5th (or so) data point labeled with the year, again as in the astronomical convention. How can I do this?
Add a new series with only the years to be shown and display the labels for that series.

Re: Astronomy binary star plot - how?

Posted: Thu Feb 27, 2025 9:09 am
by marty-0750
The ODS file
Alpha Cent orbit.ods
(44.98 KiB) Downloaded 69 times

Re: Astronomy binary star plot - how?

Posted: Thu Feb 27, 2025 9:32 am
by Hagar Delest
Lupp and I made our homework and here is the result. Lupp for the mathematical coordinates rotation and I for the second series trick to show the dates.
I let Lupp upload his file if he wishes.
Chart.png
Chart.png (11.12 KiB) Viewed 4701 times

Please add [Solved] at the beginning of the title in your first post (top of the topic) with the button if your issue has been fixed.

Re: Astronomy binary star plot - how?

Posted: Thu Feb 27, 2025 5:11 pm
by MrProgrammer
marty-0750 wrote: Wed Feb 26, 2025 11:08 am The graph however needs to be rotated 90 degrees …
Rotate the chart's data 𝛑/2 radians by swapping the X-value and Y-value ranges in Format → Data Ranges → Data Series and reversing the Y-axis: Format → Axes → Y axis → Scale → Reverse direction.

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know