Looking For a Link

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Post Reply
The Artful Dodger
Posts: 121
Joined: Sat Jul 09, 2022 3:20 pm

Looking For a Link

#1 Post by The Artful Dodger »

I am now at the stage of working on my Attitude display and, when I look at how others have solved the problem it looks like some trig is involved. The trig doesn't bother me but where do all of the constants come from? For example:

Code: Select all

-- Move horizon pitch
    pitch = var_cap(pitch,-30,30)
    radial = math.rad(roll * -1)
    x = -(math.sin(radial) * pitch * 4.25)
    y = (math.cos(radial) * pitch * 4.25)
    move(img_horizon, x-100, y-246, nil, nil)
    move(img_horizondeg, x-100, y-246, nil, nil)

When I see other solutions I see various values used (like 4.25 in the example above) but without explanation as to where they came from. Has someone done a video or a short tutorial on how one goes about solving this problem? Any help would be most appreciated!


User avatar
Posts: 6803
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg

Re: Looking For a Link

#2 Post by Ralph »

Those are a sort of multiplication factors to get the pitch at the correct position (number of pixels). This depends on the size of the instrument for example. It's no exact science, it's just filling something in until it matches.

Post Reply