So, while messing with vizzy over the last few days, I've accidentally stumbled on a mathematical relation that might help a lot of people, and I figured I should share it before I forget(this also makes a nice record for myself to come back to).

First,

the length of a vector = the absolute value of that vector.

Basically, I've found 3 different ways to calculate the distance between a craft and the center of its parent body(or the magnitude of the position vector(R = |R?|) in other words) in vizzy:

1) R = {{planet (name of planet)(radius)} + (ASL)}

2) R = {{nav (position)} (length)}

3) R = {(abs) {nav (position)}}


9 Comments

  • Log in to leave a comment
  • Profile image

    aw

    2.3 years ago
  • Profile image
    1,159 YaMomzBox420

    @FriendlyFin {nav (position)} will only give you the current crafts position relative to the current SOI. To measure the distance between your current craft and planet/moon that you're orbiting, this works great, but to measure the distance to anything else, you need to use different blocks. There's a {craft (0) (position)} block(it might not look exactly like that, but I know there's a way to ask for the position of a specific craft and it not the same as craft position), and the {planet ()(position)} block. You just type in the name of the craft or planet you want the position from and it'll give you the vectors you need. I'm not exactly sure just how "frame-of-reference" works with the vector calculations though since PCI coordinates are dependent on SOI, so it might not be very accurate without some kind of conversion between vector-spaces...

    2.3 years ago
  • Profile image

    can you use nav position block and length block to do that?

    2.3 years ago
  • Profile image
    1,159 YaMomzBox420

    @FriendlyFin Not exactly like I posted, but you could use the same principle. Unfortunately all of the calculations here are SOI dependent, so if you want to measure the distance to a different body than the current SOI, you'll need another method.

    A position vector minus another position vector will give you a third vector that connects the two points which you can then measure the length of. If it's the distance between two planets (or a planet and moon), you probably want to subtract the objects radius from that length to measure the distance between the two objects ground surfaces(as opposed to the center of the bodies).

    {(P¹-P²) (length)} - {planet ()(radius)}+{planet ()(radius)}
    P¹ and P² are the position vectors of the bodies. {planet ()(position)}

    2.3 years ago
  • Profile image

    could this be used for distance from a planet while in space and not in it’s soi?

    2.3 years ago
  • Profile image
    1,159 YaMomzBox420

    @plane918273645 I think I get what you're saying. Basically, absolute value tells you the length of a vector, but not it's direction, so it's only useful for certain specific applications where direction doesn't matter.

    The resources I'm using specify using the absolute value of a vector, so I'm sure it's okay for my purposes, but I'll definitely be careful about using it for other things.

    Also, thanks pointing that out, I really appreciate it

    2.3 years ago
  • Profile image

    Alright, it’s just since it’s ignoring direction there is no way for it to be negative @YaMomzBox420

    2.3 years ago
  • Profile image
    1,159 YaMomzBox420

    Lol I didn't think of it that way, but thanks for the explanation. I'm slowly working out the math for classical orbital elements to use for launch guidance and such, and I'm learning a lot of this for the first time by doing so. @plane918273645

    2.3 years ago
  • Profile image

    The absolute value should only really be used for scalars, but yes a one dimensional vectors length is an absolute value, as length, just like in the real world can never be negative, as negative numbers don’t exist in real terms if that makes sense

    +1 2.3 years ago

No Upvotes

Log in in to upvote this post.