Jump to content

Syntax

Members
  • Posts

    70
  • Joined

  • Last visited

Posts posted by Syntax

  1. I like to deorbit my debris using a craft that has an AGU attached. A few versions back, I had no issues with this. But now targeting debris targets the root part of the debris, not the COM, and once the klaw is attached, I can't target the COM, like I can when attached to an asteroid.

    Am I missing something? Or is there a workaround? I'd gladly install (or even write, if I knew where to start) a plugin that adds the "target COM" ability to the right click menu, or changes the game's targeting behaviour to target vessels' COM by default, or treats debris as a singular part that forces COM to be targeted.

    Does anyone have suggestions for this issue? 

  2. I was away from KSP for a while, but since I've been back, I've come to find that one can no longer target the COM of a piece of debris once latched on to it with the AGU. I seem to remember being able to do this back in the day, just as I can today with asteroids. This seems so backwards, as it's the engineered object whose COM should be able to be known, while an asteroid's should be less certain.

    I've considered options like a "pull design" tug that could perhaps work, but I'd still need to know roughly where the COM is at the time of attachment, so that's not my ideal. Also, I just feel like I should be able to know the COM of an engineered object (even if the engineers were kerbals). :P

    I'm open to other ideas and suggestions, but at this point I'm wondering what would be involved in writing a plugin that revives this capability. I imagine the devs had a reason for removing it, so maybe there is some big barrier to success here, but it seems like it might be worth a try... 

    I've written up contract packs and waypoint collections in the past, and have a bit of "backend" experience, so something (seemingly) simple like this seems like it would be within my capacities. I'm just not too sure where to begin. Any help would be appreciated! 

  3.   Can someone help shed some light for me?

    I thought I knew SCANsat... but then I found this, and I honestly don't get it. There is so much data here, and all the people responding are so excited about it... and I don't understand what the data means or why it pleases people or how it could be useful to me as a SCANsat user.

    I know that different scanner parts have different ideal orbit altitudes, and that small adjustments to that altitude will make for more complete scans of the surface, but this... this is something more, no?

    I think of myself as fairly well versed in KSP and its mechanics (orbital mechanics and game mechanics), but the significance of these graphs continues to elude me. I know some have to do with other mods that I don't use (KSPI, MKS, Karbonite, EPL), but what about the base SCANsat stuff?

    For example, what are the "Ideal Zones" graphs about? I don't think I know how to even read them properly, let alone what they describe.

    And what the heck is a resonance structure? (And Sidelaps?)

    And why was it not important to @technogeeky to include the data pertaining to the Kerbin system? Or did he, and I just missed it?

    :/

    Any help with understanding all this will be much appreciated.

     

  4. I thought I knew SCANsat... but then I found this, and I honestly don't get it. There is so much data here, and all the people responding are so excited about it... and I don't understand what the data means or why it pleases people or how it could be useful to me.

    I know that different scanner parts have different ideal orbit altitudes, and that small adjustments to that altitude will make for more complete scans of the surface, but this... this is something more, no?

    I think of myself as fairly well versed in KSP and its mechanics (orbital mechanics and game mechanics), but the significance of these graphs continues to elude me. I know some have to do with other mods that I don't use (KSPI, MKS, Karbonite, EPL), but what about the base SCANsat stuff?

    For example, what are the "Ideal Zones" graphs about? I don't think I know how to even read them properly, let alone what they describe.

    And what the heck is a resonance structure? (And Sidelaps?)

    And why was it not important to the author to include the data pertaining to the Kerbin system? Or did he, and I just missed it?

    :/

    Any help with understanding all this will be much appreciated.

     

  5. On 4/22/2020 at 12:50 AM, K^2 said:

    Yeah, the golden section search can be used to look for local minima or local maxima. You just have to flip the inequality used to decide whether you pick the left node or the right node inside the iteration. Likewise, the outer loop compares results from golden section for each arc segment to find the global optimum. You'll need to flip that inequality as well. And I don't recall how I initialized the initial best distance. Given that we were searching for maximum, it was probably set to zero. If you're looking for minimum, you should set value to something greater than theoretical maximum. Sum of semi-major axes is absolutely guaranteed to be greater than actual minimum separation, so it's a good choice.

    Nice! Thanks! I managed to make it work. I ended up leaving the initial value for the minimum distance unspecified. When I use the code below, the true anomalies spit out at the end were 0 (or whatever value I passed in that initial value array). I couldn't figure out why, as that didn't happen with the max distance array reduction.

    const res = distances.reduce((a, b) => a[0] < b[0] ? a : b, [a1 + a2, 0, 0]);

    But it worked without that initial value... just thought that was a bit strange. Anyway, thanks so much for your guidance! You've really helped me tie a nice bow on this :)

  6. On 12/5/2018 at 7:10 PM, K^2 said:

    Yeah, I don't see anything that would account for 0.05 radian difference. The steps I use to break down the arc are 0.2, and using golden section pretty much prevents it from getting stuck on 1/4 of that for some numerical reason. It's also not a precision issue, since that's well within even single precision, let alone double. The max2d is set to 10-6 as well, so again, right out.

    If you want to try diagnosing it further, try computing positions using your algorithm and the JS code I provided using the same identical orbital elements and a few values for true anomaly between 0 and 2pi. If you get a difference, you can start tracking it back to see which numbers are coming up different in between.

    I'm sorry to necro this. I thought you might be interested in knowing that I did get to the bottom of this issue some months ago, but haven't done much with the results yet. I'm starting to work on it again... I find myself with more free time lately... Turns out the problem was a silly calculation error on my end, and both your code and my model in fact were returning identical results (long story short, I was conflating true anomaly and eccentric anomaly).

    More as an exercise and diversion than anything else, I am now wondering: What would I need to change about the original code to use it to find the absolute minimum distances between two orbits? If I understand correctly, the golden section search you employed is a twist on a method to find local minima. If I could "untwist" it (whatever that might mean), could I employ it in just that fashion? I'm working on trying to reverse engineer it, but my limited background isn't getting me very far very fast. Figured I'd go to the source :)

  7. So I've been away from KSP for about 3 years. I've always missed playing it, but I fell away and got caught up in other projects.

    Last time I played was in 1.2. KSP2 hadn't yet been announced and Making History and Breaking Ground were but glimmers in the devs' eyes. I was good enough at the game to feel comfortable with landing on Mun and Minmus, rendezvous and docking, I had several mods installed and had played around with planes and VTOLs a bit. I had probably a couple hundred hours docked, but I never got around to leaving  the Kerbin SOI... Though I was on the brink of such a mission before I put the game down back in 2016.I was watching a lot of Scott Manley videos to prepare ;)

    Now I have some time and I'm looking forward to getting back into it in the new year, but I feel like I'm starting from scratch. So I figured before I jump back in, I'd ask the ol' community for a primer. Any pointers, advice, suggestions, guidance, recommendations, resources are welcome! Here are some prompts in the form of things I'm curious about:

    What new stock features are there?

    What still sucks in stock? In 1.2, aero forces and wheels were the achilles heel of the game. At least there was the Far mod for the former... 

    ARE WHEELS FIXED?? 

    Which major mods have been deprecated or abandoned, and what awesome new ones have come out? Is spacedock still the go-to repository?

    Is the community still as active as it was 3 years ago? 

    Are people excited about KSP2?

    Is KSP still under active development, or has that slowed/stopped to work on the sequel? 

    Who's who in the community these days? I think I've seen that Manley is still active as a YouTuber... who are some others to look out for as I take aim at the rest of the solar system?

  8. @K^2 Whelp, I'm out of ideas at this point. I've learned enough about rotation matrices in the last few days to understand how to reproduce your transformX and transformY functions. I was hoping to find some minor discrepancy that, when resolved, would close the gap between the results. And the rotation matrices I came up with did differ slightly from yours, by a negative sign in the variable z for each. Changing it didn't make any difference at all.

    I checked the rotation matrix against the orbits' orientations in my model, and they are visually identical.

    As for bignumbers, I don't see how I could apply it in a way that would make any difference at all. I haven't tried it, because honestly I'm not sure where I would.

    I've played around with the degree of accuracy in your code, pushing it to the limit of crashing the browser page. No luck there, either. Would a more powerful machine even help, or will the browser always be the bottleneck?

    I don't understand why my model and your code agree on the max separation, but disagree on true anomaly. I'll keep thinking on it, but I'm definitely open to more ideas if you've got 'em. Maybe I'm missing something in the max2d or golden function... Again, I'll keep exploring.

  9. On 11/30/2018 at 1:22 AM, K^2 said:

    @Syntax Well, it depends on how hard-core you want to get into it.

    @K^2Really, just enough to work out what's causing that 0.05 rad discrepancy. I'm happy to research and learn, but it can be hard to know where to look, and my formal mathematics training ended with high school calculus.

    Quote

    Texas A&M has decent slides up from a course a few years back. The three most relevant chapters, leading up to the actual coordinate transformations, are as follow:

    http://www.math.tamu.edu/~yvorobet/MATH304-2011C/Lect2-03web.pdf

    http://www.math.tamu.edu/~yvorobet/MATH304-504/Lect2-06web.pdf

    http://www.math.tamu.edu/~yvorobet/MATH304-2011C/Lect2-10web.pdfIf you can follow these slides from start to end, you basically know as much about coordinate transformations as anyone, (again, so long as we stick to neat, linear transformations, such as rotations in Euclidean space).

    These are definitely well out of my league. Thank you for the resource, though. Who knows, I may end up to coming back to them.

    Quote

    For a much simpler overview, you can look at some practical tutorials for video games. And it might be way easier to get a hang of it in 2D, since you can draw neat little pictures for yourself. Again, just following a quick search, this one looks like it covers the basics:

    https://www.alanzucconi.com/2016/02/10/tranfsormation-matrix/

    This sort of thing won't give you the deep insight into why it works, and prepare you for more general cases, but if learning Linear Algebra is beyond your time availability, looking for tutorials like this one might be a good start.

    This helped a lot, and I'm going to try to find more stuff like this. Just about the only thing left in your JS that I don't understand is the transformX and transformY functions, and I'm hoping that with that last puzzle piece I can close the book on this.

  10. @K^2 Thank you SO MUCH for what you've done here. You've single-handedly brought me to within a hair's breadth of the solution to this problem that has been bugging me for months!

    I say "within a hair's breadth" because, oddly, when I put the true anomalies output by your algorithm into my model, I get a distance of 113191.131383 Mm, a difference of 169.675468 Mm from your algorithm's output (113360.806852). But, when I play around with fine adjustments to those body positions in my model, I can maximize the distance calculated in the model to within <10m of the algorithm output! So I just need to figure out why the true anomalies I'm finding are around 0.05 rad off from yours. I really believe my model is accurate... but perhaps more checks on that are in order. Whether the issue lies with my model or your code, I will continue looking into this and keep you updated.

    I'm sorry I needed so much hand holding on this... it's that I don't have a good grasp on the math used to transform the ellipses from 2D into 3D. Any resources you could recommend for me to read/watch to deepen that skill set?

  11. 41 minutes ago, K^2 said:

    I'm still going to take a closer look at the code, but I just made a quick plot, and it looks believable, at least.

    ...

    Note that true anomaly is angle from periapsis, not from datum. So for Dres, you need to add 90o.

    @K^2That does look more believable. Seems likely I'm having issues on my end. Not sure why, though. I will also continue looking.

    One thing I do notice (and this could help explain our discrepancies), is that on the graph you provided, it looks like Dres' periapsis lies on the positive y-axis, and Jool's orbit swings away from it to the upper left. When I look at my model (and indeed at the map screen in KSP) in that orientation, Jool's orbit swings away from Dres' to the upper right when looking straight down at it.

  12. 42 minutes ago, K^2 said:

    Can you give me the parameters you've been using, just to make sure I'm reproducing exactly the same thing?

    Sure can!

    Jool
    SMA: 68773.56032
    e: 0.05
    Inc: 0.022759093795546
    LAN: 0.907571211037052
    APe: 0

    Dres
    SMA: 40839.348203
    e: 0.145
    Inc: 0.0872664625997166
    LAN: 4.88692190558413
    APe: 1.57079632679490

    Thanks so much for all your help! This is amazing.

  13. On 11/24/2018 at 7:58 PM, K^2 said:

    The focus is at the origin. The polar form used is r(θ) = a (1 - e²) / (1 + e cos(θ)). So r(θ) is minimal at θ = 0, corresponding to periapsis. This is then cast to Cartesian coordinates, matching θ = 0 to the positive x axis, and keeping the ellipse in the XY plane. The transform components tx and ty are then used to rotate the ellipse in 3D to match orbital elements, keeping the focus at the origin.

    @K^2 That's fantastic. Thanks for clarifying. I see it now.

    Thing is... something's not adding up. I've made this model (linked in my signature) against which I'm checking the angles and distances this script is spitting out. I've been using Dres and Jool... and I'm getting a max distance that I can't seem to replicate no matter how hard I try (off by 3Gm!). Plus, the angles are just plain nonsensical. I don't know what is leading to the inconsistencies. I'm trying to get it to add up, but no luck yet.

    If you get a chance to look at what I'm talking about, I'd be interested to hear your thoughts on a diagnosis.

    Here's what I've done with the code you provided. I'll warn you: it's not pretty; I'm not good enough at this to make it streamlined.

     

    Spoiler
    
    <html>
    <head>
    <script language="JavaScript">
    // Inverse square and inverse of golden ratio.
    const phi1 = 0.38196601125;
    const phi2 = 0.61803398875;
    // One, three, and five quarters of pi.
    const oqpi = 0.78539816339;
    const tqpi = 2.35619449019;
    const fqpi = 3.92699081699;
    
    // Golden section search for a maximum.
    function golden(x1, x2, f) {
    	x0 = x2;
    	x2 = x2 - x1;
    	let v1 = f(x1 + phi1 * x2);
    	let v2 = f(x1 + phi2 * x2);
    	let ref = f(x1);
    	for (i = 0; i < 30; ++i) {
    		if (v1 > v2) {
    			v2 = v1;
    			x2 *= phi2;
    			v1 = f(x1 + phi1 * x2);
    		} else {
    			v1 = v2;
    			x1 += phi1 * x2;
    			x2 *= phi2;
    			v2 = f(x1 + phi2 * x2);
    		}
    	}
    	return x1 + 0.5 * x2;
    }
    
    // Rudimentary 2D maximization. Assumes nothing fancy going on.
    function max2d(x1, x2, y1, y2, f) {
    	let x = 0.5 * (x1 + x2);
    	let y = 0.5 * (y1 + y2);
    	let v = f(x, y);
    	while (true) {
    		y = golden(y1, y2, (z) => f(x, z));
    		x = golden(x1, x2, (z) => f(z, y));
    		const nv = f(x, y);
    		if (Math.abs(nv - v) / (Math.abs(v) + Math.abs(nv)) < 1E-6) {
              // modify return value
    			return [nv, x, y];
    		}
    		v = nv;
    		
    	}
    }
    
    // Transforming X axis from 2D ellipse to 3D.
    function transformX(i, O, w) {
    	const x = Math.cos(w - O);
    	const r = Math.sin(w - O);
    	const y = Math.cos(i) * r;
    	const z =-Math.sin(i) * r;
    	const c = Math.cos(O);
    	const s = Math.sin(O);
    	return [x * c - y * s, x * s + y * c, z];
    }
    
    // Transforming Y axis from 2D ellipse to 3D.
    function transformY(i, O, w) {
    	const x =-Math.sin(w - O);
    	const r = Math.cos(w - O);
    	const y = Math.cos(i) * r;
    	const z =-Math.sin(i) * r;
    	const c = Math.cos(O);
    	const s = Math.sin(O);
    	return [x * c - y * s, x * s + y * c, z];
    }
    
    // 3D Position at true anomaly T.
    function position(tx, ty, a, e, T) {
    	const c = Math.cos(T);
    	const r = a * (1 - e * e) / (1 + e * c);
    	const x = r * c;
    	const y = r * Math.sin(T);
    	return [tx[0] * x + ty[0] * y, tx[1] * x + ty[1] * y, tx[2] * x + ty[2] * y];
    }
    
    // Eucleidan distance.
    function distance(p1, p2) {
    	const x = p1[0] - p2[0];
    	const y = p1[1] - p2[1];
    	const z = p1[2] - p2[2];
    	return Math.sqrt(x * x + y * y + z * z);
    }
    
    // Putting it all together.
    function compute() {
    	// Set up parameters.
    	const i1 = parseFloat(document.getElementById("i1").value);
    	const O1 = parseFloat(document.getElementById("O1").value);
    	const w1 = parseFloat(document.getElementById("w1").value);
    	const tx1 = transformX(i1, O1, w1);
    	const ty1 = transformY(i1, O1, w1);
    
    	const i2 = parseFloat(document.getElementById("i2").value);
    	const O2 = parseFloat(document.getElementById("O2").value);
    	const w2 = parseFloat(document.getElementById("w2").value);
    	const tx2 = transformX(i2, O2, w2);
    	const ty2 = transformY(i2, O2, w2);
    
    	const a1 = parseFloat(document.getElementById("a1").value);
    	const e1 = parseFloat(document.getElementById("e1").value);
    	const a2 = parseFloat(document.getElementById("a2").value);
    	const e2 = parseFloat(document.getElementById("e2").value);
    
    	// This is the actual distance function.
    	const f = (T1, T2) => distance(position(tx1, ty1, a1, e1, T1), position(tx2, ty2, a2, e2, T2));
    
    	// Compute distances in 4 quadrants.
    	// modify this section to handle modified max2d output
    	const d0 = max2d(oqpi, tqpi, oqpi, tqpi, f);
    		const d00 = d0[0];
    		
    	const d1 = max2d(oqpi, tqpi, tqpi, fqpi, f);
    		const d01 = d1[0];
    		
    	const d2 = max2d(tqpi, fqpi, oqpi, tqpi, f);
    		const d10 = d2[0];
    		
    	const d3 = max2d(tqpi, fqpi, tqpi, fqpi, f);
    		const d11 = d3[0];
    
    	// Final result.
    	const d = Math.max(d00, d01, d10, d11);
    	document.getElementById("max").innerHTML = d;
    	
    	// Modify to show position result.
    	const arrdarr = [d0, d1, d2, d3];
    	const darr = [d00, d01, d10, d11];
    	const dind = darr.indexOf(Math.max(...darr));
    	
    	const apearr = arrdarr[dind];
    	const tran1 = apearr[1];
    	const tran2 = apearr[2];
    	
    	document.getElementById("T1").innerHTML = tran1;
    	document.getElementById("T2").innerHTML = tran2;
    	
    	// True anomaly to eccentric anomaly
    	document.getElementById("ecc1").innerHTML = Math.PI-(Math.asin((Math.sqrt(1-e1*e1)*Math.sin(tran1))/(1+e1*Math.cos(tran1))));
    	document.getElementById("ecc2").innerHTML = Math.PI-(Math.asin((Math.sqrt(1-e2*e2)*Math.sin(tran2))/(1+e2*Math.cos(tran2))));
    	
    	// Modify to show body coordinates.
    	const pt1 = position(tx1, ty1, a1, e1, tran1);
    	const pt2 = position(tx2, ty2, a2, e2, tran2);
    	document.getElementById("pos1").innerHTML = pt1;
    	document.getElementById("pos2").innerHTML = pt2;
    }
    </script>
    <style>
    .grid { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; grid-gap: 5px; }
    .head { grid-column: any / span 2; }
    .label { justify-self: end; }
    </style>
    </head>
    <body>
    <div class="grid">
    <div style="grid-column: 1/span 2;">Body 1 orbital elements:</div>
    <div style="grid-column: 3/span 2;">Body 2 orbital elements:</div>
    <div class="label">Semimajor axis:</div><div><input size=10 id="a1"/></div>
    <div class="label">Semimajor axis:</div><div><input size=10 id="a2"/></div>
    <div class="label">Eccentricity:</div><div><input size=10 id="e1"/></div>
    <div class="label">Eccentricity:</div><div><input size=10 id="e2"/></div>
    <div class="label">Inclination (rad):</div><div><input size=10 id="i1"/></div>
    <div class="label">Inclination (rad):</div><div><input size=10 id="i2"/></div>
    <div class="label">Ascending node (rad):</div><div><input size=10 id="O1"/></div>
    <div class="label">Ascending node (rad):</div><div><input size=10 id="O2"/></div>
    <div class="label">Periapsis (rad):</div><div><input size=10 id="w1"/></div>
    <div class="label">Periapsis (rad):</div><div><input size=10 id="w2"/></div>
    <div style="grid-column: 1 / span 4;">
    <input type="button" value="Compute" onclick="compute()"/></div>
    </div>
    <br>
    <div class="label">Greatest separation:</div><div id="max"> </div>
    <div class="label">True Anomaly 1:</div><div id="T1"> </div>
    <div class="label">True Anomaly 2:</div><div id="T2"> </div>
    <div class="label">Ecc. Anomaly 1:</div><div id="ecc1"> </div>
    <div class="label">Ecc. Anomaly 2:</div><div id="ecc2"> </div>
    <div class="label">Position 1:</div><div id="pos1"> </div>
    <div class="label">Position 2:</div><div id="pos2"> </div>
    </body>
    </html>

     

     

  14. On 11/23/2018 at 12:32 AM, K^2 said:

    You can feed each one in turn to the position function with corresponding parameters if you want the cartesian coordinates.

    My cup overflows! Thank you!

    I will try this out tonight. 

    Am I correct in my understanding that the centre of the ellipse (and not one of the foci) is at the origin?

  15. On 11/21/2018 at 2:41 AM, K^2 said:

    Anyways, just paste this mess into the editor and save it as an .html file. No error checking, so make sure all fields are filled in before you hit the button. Otherwise, should work.

    This. Is. Incredible! You're my hero! Thank you!

    Purely for curiosity's sake, do you think there would be a relatively simple way to determine the points the two bodies would have to be at in their orbits to achieve their max separation? Looking at your code, I see a position function devoted to "3D Position at true anomaly T." That looks like the ticket!

    I'm having a hard time getting that value onto the browser page, though. I think it's because I haven't looked at JS in some time and am not at all familiar with the arrow function... what do I need to do here?

  16. 1 hour ago, K^2 said:

     @Syntax I don't know how good you are with numerical methods / code. If you want, I can write you a script in language of your choice that takes orbital elements as inputs and spits out max separation and relevant parameters for it. If that does you any good, it shouldn't take me more than half an hour to write.

    That would be incredible! I'm very much a beginner with code, but do have some limited experience with javascript, ruby, and (to an even lesser extent) python. If any of those work for you, I'd be "over the moon" just to have something to work from. I will say, though, that I'd need some clear commenting. All the internets to you for such a favor!

  17. I'm looking for some help/guidance on what is turning out to be a surprisingly challenging math problem:

    I'm trying to find the maximum possible separation between any two given planets. I think it would be useful, or at least interesting, to know this kind of thing when constructing comms relay networks, etc.

    I've got some idea how to proceed, but my efforts keep coming up dry (not least because of my merely intermediate math knowledge). Seems my problem needs new eyes and new ideas. I'm all ears! 

  18. 5 hours ago, Drew Kerman said:

    Derp.

    Do you at least know how to get hyperbolic orbit conics showing? I don't know if I could figure out the positioning but at least it would be closer to being figured out that I just might be able to work the maths from there myself with enough research...

    I got one showing here: 

    But I thought you had already seen that... I don't mind playing around a bit more with the math, but I can't promise results or give you much of an idea of when I'll get to do that, so I'd definitely encourage you to dig into it yourself.

    I'd like to help here, though. I'll do what I can!

  19. On 10/13/2018 at 11:40 AM, Drew Kerman said:

    @Syntax I'm dedicating time to coding improvements in my Ops Tracker. Any chance you have some free time too? I'm still curious as to whether things are made easier by not having to chop off orbits with ecc<1 but that still extend outside of the body's SOI

    Hi Drew, I take it you mean ecc>1?

    The problem is not how to constrain the conic. It's how to represent the asteroid's position on that conic. For the closed ellipses of all the planets and moons, the orbiting body is represented by a point that is mathematically tied to that path. Not so easy with the open hyperbola. KSP must have a way of doing it, though... 

  20. On 6/6/2018 at 11:26 AM, Drew Kerman said:

    pretty much the same as what's there for parabolic ones. I'd like to be able to plot them in the figure and show a point along them that is the current position of whatever is on that trajectory.  Here is an example orbit from an asteroid swinging by Kerbin:

    SMA: -20601.2664 (km)
    Ecc: 3.4136
    Inc: 44.2831°
    RAAN: 265.9142°
    Arg: 239.4316°
    True Anom: -61.8867°

    I've been futzing around a bit with your idea this week and I think I've got the beginnings of something you might be able to work with here. All I've added is some numbers and formulas in column S of the spreadsheet. 

    One tricky thing with representing a hyperbolic orbit on a 3d plot is that we only want to see one of the branches (here, the one swinging by Kerbin). So right away the more obvious choices for commands to use in geogebra are ruled out: Hyperbola command, Conic command

    So that leaves me with the Curve command, which uses parametric equations to plot a curve in a given range. I have not yet been able to figure out how to parameterise a hyperbola in 3 dimensions, so I tried plotting one in 2D that had your example's SMA and Ecc, and then tried to rotate that curve to the proper 3D orientation. I doubt I've managed to get it right on my first go. Take a look and tell me how it compares to your example. I can't test in KSP just now.

    It would be more computationally efficient if we could represent the hyperbola in 3D right out of the gate, so that's another challenge. 

    It will be up to you to define a range for the curve (given in cell S23) that you think is appropriate. But once you've done that, how do you define the asteroid's actual position on that arbitrarily sized curve? Perhaps it would be better, in the case of hyperbolic trajectories, to represent the trajectory shape and the asteroid position independently, as opposed to interwining them as I did for elliptical orbits.

    But we have the beginning of something here. 

  21. 46 minutes ago, Drew Kerman said:

    just popping by to say, if anyone out there wants to get hyperbolic trajectory plotting working you would be my hero. That is all.

    Actually also wanted to say still looking to make a dedicated page to put in orbital data and render out a figure but I'm way behind on what I would like to do right now :P

    Hey Drew. I have not abandoned this! I have not done any updates but have been using it myself for a project of my own. 

    Point is, it's very much on my radar. As for hyperbolic trajectories, it's secondary to my interests but perhaps I could look into it when my own project gets wrapped up. What kind of functionality  are you looking for specifically? 

  22. On 19/07/2017 at 11:15 PM, Drew Kerman said:

    I'd like to show the rings around Sarnus and Urlum - I don't suppose there's a way I could do that? I know I can show the extent of the ring plane, but I'm wondering of it's possible to also show the gap between the planet and ring somehow

    This should be do-able, but there's a chance the model will take a performance hit. I think what you need is a parameteically defined curve (google parametric equation for details). When I tried using them in my model, they made GeoGebra hurt. But I was trying to do all sorts of funny stuff with them. Ideally, I'd try to go with something else, but I'm not sure what that would be off the top of my head.

    40 minutes ago, Drew Kerman said:

    ok I took a look at the functions you listed for hyperbolas and yea - I have no clue. I honestly don't even know where to begin to get the two focus points needed. I never really made it past algebra in high school and didn't make it through college. So you'll have to either help me out or pass along even more references for me to work backwards further to learn what I need

    I feel your pain. I did algebra in high school but nothing really beyond that. Google was a very good friend to me through this process. I would love to help you, but it will be at least a few weeks before I can really sit down with this and try to work it out. I'm in the midst of a renovation and a move. Next chance I get I'll take a look and let you know what I come up with, but I encourage you to keep at it in the mean time.

    Keep posting updates and asking questions :) I love that I'm not the only one getting use out of this, and I quite like sharing what I've learned while making it.

  23. On 7/14/2017 at 5:20 PM, Drew Kerman said:

    Some questions/issues for you:

    • why is Pol's Foci colored red?

      • Some strange bug in GeoGebra was causing the value of Pol's Ap Radius minus Pe Radius to display incorrectly by 3x10^-14 in the spreadsheet. I had to do a manual correction, and highlighted it (orange) in the spreadsheet as an anomaly. I actually noted this in the object's caption :) In my version, it's only the spreadsheet cell that is coloured. Is the point itself coloured on your end? It's possible the colouring in the spreadsheet could be causing display issues in your implementation; I've found inconsistencies like that before in the different implementations of GeoGebra. Try removing the colour in spreadsheet.

    • why is sun's SOI radius colored red?

      • Same thing as above. I coloured the cell in the spreadsheet to highlight that it's a sort of anomaly. Reason is noted in the caption. Note that actual Sun SOI is infinite.

    • I added a gray background to the last row of cells since the white text didn't show and at first I thought they were all empty!

      • I did the same thing. Didn't display properly for you? *exasperated sigh*

    • Some of the column A "header" cells that defined the sections of values were off by one vertical cell

      • Bizarre! This happened to me many times as I changed things in the model and added/removed rows, but I thought it had been addressed, as it does not display this way in my version. I'm going to change the DL link to a dropbox file or something so none of my meticulous formatting gets removed :huh:

    • For some reason Vall and Bop or alternately just Vall have reference plane equations (no harm noted, just weird)

      • They should not, and do not, in my versions. Wish I could explain better than that.

    • I can't create new columns. I try to right-click the column header and select (Insert Right) but nothing happens. I found that selecting a cell and choosing the "Record to Spreadsheet" option will create a new cell, I just delete the recording. Have you found any easier way?

      • Right clicking on the column header should do the trick. I'm not sure why you're having that problem. You've downloaded the version I've marked as being customizable? Maybe try in the new file when I upload it. And remember to add new columns past Eeloo (column R).

    • in the wiki, on adding new bodies, "row 28, 30" should be "row 28, 32"

      • Right you are. Thanks for the note! Fixed.

    • Not sure what you mean by "adapt text in <angle></angle>"

      • I meant "adapt text in <angle brackets>" but the html encoding threw off the display :P Fixed!

    • Adding a new number to the list for the body selection caused it to disappear - took me a while to figure out it had switched off its visibility flag for some reason. Same happens to the phase angle selection boxes.

      • Wierd! :P

     

    1 hour ago, Drew Kerman said:
    • Any particular reason you chose to use Mm?
      • km was too small to be sensible for distant bodies and GM was to big to be sensible for properties like body radius.
    • Why do Mun/Minmus have different equations for Conics as opposed to Tylo, Laythe and Vall? I'm thinking the one for the Joolean moons was a later development? Nope, I implemented UT update when the figure finishes loading and noticed Kerbin's location was way off. I used the Rotate(Circle(origin, F22, F20), π + F11, zAxis) equation instead and it's fixed now
      • Yes, you've hit the nail on the head here. Geogebra draws circles in a rather strange way, and so I had to rotate them to make sure the planets and moons on circular orbits were starting at the appropriate spot. Now that I take another look at it, though, I can't think of why I didn't make that change to Tylo, Laythe, and Vall. I think I'll need  to go back and update that. Thanks, and good catch!
    • KSPTOT gives me higher precision to use with True Anomaly than Mean Anomaly for a given UT. Dunno if that matters tho
      • Really not sure what you mean about this. In the model, the position of bodies on their orbits is given by eccentric anomaly, which is determined based on mean anomaly at UT=0 and total elapsed time. If there's another way to do this, I'm open to ideas. Can you explain a little more what you're getting at.

     

    Aaaannnddd... yea. That's pretty much feature complete after a  5hr marathon coding session! @Syntax my next step is to create planetary system figures for all the bodies. Is there anything special I need to do when working at that smaller scale?

    • Everything should be the same. Do be aware that GeoGebra can't zoom in infinitely and you'll eventually run into artefacts if you go too far, but using Mm instead of Gm should take care of that

    If I get bored in the future I will use the empty lower-right corner to host an icon that will expand a dialog down there when clicked to let people play with time and animate the system forwards/backwards (have already tested and the animation works fine). For now tho things will stay locked to the current time.

    • Don't forget to link to this thread for due credit :wink:

    Also any idea on how a hyperbolic orbit might be represented? There are some orbits that will render partially outside SOI, but I'm talking specifically handling orbits with an eccentricity greater than or equal to 1. I suppose that would be plotted as an arc as opposed to an ellipse or circle

     

×
×
  • Create New...