12-15-2023 09:14 AM
"Hello! If you want to represent Kepler's laws and illustrate the elliptical orbit of the Earth around the Sun using LabVIEW,
12-15-2023 09:37 AM
You would do it exactly the same as in any other programming language.
Just calculate the curve and display it in an xy graph. How far did you get?
12-15-2023 09:51 AM
"I have already created a program that draws a circle. Now, I want to modify it to draw an ellipse, and I want the ellipse to move at a speed satisfying Kepler's laws. Additionally, I would like to represent the Sun.
12-15-2023 10:10 AM
Christian:
His code looks very familiar, no?
https://forums.ni.com/t5/LabVIEW/Graphing-a-Customizable-Circle/td-p/3752271
-AK2DM
12-15-2023 10:11 AM - edited 12-15-2023 10:37 AM
Hmm, that code looks very familiar... 😄 Do you fully understand what it does?
Since you obviously did NOT write the code you attached, it would be polite to provide a link! If you don't give a reference, people might think you wrote it and assume you are a seasoned programmer, which is obviously not true. 😮
So you have a 1D array of complex numbers where RE=X and IM=Y. You can calculate an array of points for any other curve. Right?
All you probably need to do is replace the fixed radius with a 1D array (same # of points) calculated according to the polar form of an ellipse. Seems trivial to do, right? You already have an array of angles!
12-15-2023 10:25 AM
Though the code is not 1:1, when I saw the coding style I thought of a very neat postage stamp style coder...
-AK2DM
12-15-2023 10:41 AM
It actually is 1:1, exactly what I attached in my linked message back in 2018. 😄
Here's a modification to draw an ellipse based on eccentricity and minor axis. (Intentionally no code attached!).
Note that this is not the solution for the planetary motion! It is left to the student to center it an one of the foci!
12-15-2023 09:00 PM
Thank you! With your advice, it seems like it will be possible to resolve the issue
12-16-2023 09:28 AM
Of course you should add a few more features:.