Jump to content

Recommended Posts

Posted (edited)

What direction is it you want to know, the direction your plane has to fly to get to the target? Do you mean course with your aircraft and not a compass as reference?

 

If so, in your picture, the direction to take for the goal is

 

modulo(123+180, 360) = 237°

if direction_goal >= direction_airplane
   course = direction_goal - direction_airplane
else
   course = 360 - direction_airplane + direction_goal
end

This is all pseudo code because i'm not intimately familiar with lua.

Edited by sobek

Good, fast, cheap. Choose any two.

Come let's eat grandpa!

Use punctuation, save lives!

Posted

Great, thanks very close but we had managed wrong

 

 

my course is your right thanks!

 

 
my error

if ely_mia_direzione > 180 then
dir_1= (360 - ely_mia_direzione) + (ely_direzione_oby)
else
dir_1 = ely_direzione_oby - ely_mia_direzione
end

====VIAF====

Spinter 155° "Pantere Nere"

 

TsSimComms

 

My Site aiupgrade.net

 

 

 

Posted

Quickest way: Take the arctangent of the result of dividing the rise over the run from the aircraft to target. Convert result to degrees and then add degrees based on quadrant.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...