Flight Question Target Elevation Angle

Wolf

Donator
Donator
Joined
Feb 10, 2008
Messages
1,091
Reaction score
11
Points
38
Location
Milan
Is there a way to get or derive the orbiting target elevation angle in Orbiter?
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
I'm not sure I understood the question: do you mean you're on the ground and you want to know the angle from the horizon of an orbiting vessel/object?
 

asbjos

tuanibrO
Addon Developer
Joined
Jun 22, 2011
Messages
696
Reaction score
259
Points
78
Location
This place called "home".
I've used this solution earlier to find the elevation angle of the Sun (SelectedObject) from the location of a vessel (FocusObject)
PHP:
oapiGetRelativePos(FocusObject, ReferenceObject, &StarReferenceVector);
oapiGetRelativePos(FocusObject, SelectedObject, &StarSelectedVector);
StarAngle = acos((StarSelectedVector.x * StarReferenceVector.x + StarSelectedVector.y * StarReferenceVector.y + StarSelectedVector.z * StarReferenceVector.z) / (length(StarSelectedVector) * length(StarReferenceVector))) - PI05;

It simply uses the two vectors towards the Earth [math]\vec{r_E}[/math] and towards the Sun [math]\vec{r_S}[/math] and finds the angle using the usual vector angle formula [math]\theta = \arccos {\frac{\vec{r_E} \cdot \vec{r_S}}{|\vec{r_E}| \cdot|\vec{r_S}|}}[/math], and then in the end subtract [math]\frac{\pi}{2}[/math] because I want the angle above the surface, not between Earth's centre and the Sun.

And then if you want to find out if the Sun (or any other object) is above the physical horizon (which will be below 0 degrees, as the Earth curves down under you), you use this extra set of code
PHP:
StarReferenceAngle = acos(oapiGetSize(ReferenceObject) / length(StarReferenceVector)); // Angle of horizon
if (StarAngle + StarReferenceAngle < 0)
	sprintf(StarIsOverHorizon, "Under");
else sprintf(StarIsOverHorizon, "Over");
 
Last edited:

Wolf

Donator
Donator
Joined
Feb 10, 2008
Messages
1,091
Reaction score
11
Points
38
Location
Milan
Sorry for not being very clear with my question. I mean the elevation angle between the chaser and the target during orbit phasing for rendezvous operations
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,627
Reaction score
2,345
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Sorry for not being very clear with my question. I mean the elevation angle between the chaser and the target during orbit phasing for rendezvous operations

manual method: Surface MFD, Read elevation on the pitch scale.
 

Wolf

Donator
Donator
Joined
Feb 10, 2008
Messages
1,091
Reaction score
11
Points
38
Location
Milan
manual method: Surface MFD, Read elevation on the pitch scale.

Not sure I understand:I guess what you mean is you first need to point your nose (X axis) towards the target and then read your Pitch value which in a LVLH frame equals to the elev angle, is that correct?
If this is the way how can I do that with SSU in MM201 UNIVPTG? AFAIK TGT ID 1 (Orbit target) is not implemented yet...
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,627
Reaction score
2,345
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Not sure I understand:I guess what you mean is you first need to point your nose (X axis) towards the target and then read your Pitch value which in a LVLH frame equals to the elev angle, is that correct?

Ah, you mean especially in SSU. Again, unless you need especially accurate calculations, you can do this by three methods right now:

- Rendezvouz radar
- HUD
- COAS.

The first one should be more accurate, but requires more math

If this is the way how can I do that with SSU in MM201 UNIVPTG? AFAIK TGT ID 1 (Orbit target) is not implemented yet...

I am working on it. :hailprobe:
 

Wolf

Donator
Donator
Joined
Feb 10, 2008
Messages
1,091
Reaction score
11
Points
38
Location
Milan
Ah, you mean especially in SSU. Again, unless you need especially accurate calculations, you can do this by three methods right now:

- Rendezvouz radar
- HUD
- COAS.

The first one should be more accurate, but requires more math

I'd like to know the actual elevation angle in order to properly perform the -Z tracking of my target with the actual MM201 capability. If the value is for example +12° then I can use UNIVPTG with TGT ID=2 and Body Vector=5 and simply subracting the elevation angle to 360 (in this case P=348) will orient the Shuttle on a -Z track attitude
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,627
Reaction score
2,345
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Yes - but unless you write a special Lua script for Orbiters LuaMFD interpreter, you would have to use wait for others to come up with a solution.
 
Top