Profile image

Funky trees help with rate of climb indicator (It’s all good I got it working :D)

227k jamesPLANESii  4.2 years ago

So currently I’m making a 100% accurate rate of climb indicator that accounts for your angle of slip and angle of attack so it knows exactly what direction you’re going, and this is my equation atm:

clamp(sin(PitchAngle) + (AngleOfAttack * cos((pi / 180) * RollAngle) + (AngleOfSlip * sin((pi / 180) * RollAngle))) * (TAS / 5.08), -2.5, 2.5) 

For some reason, with this equation, it seems to be just amplifying my AOA and AOS a ridiculous amount... even though I have an equation that prevents that... or at least it should be.

So what am I doing wrong?
Specifically looking at the (AngleOfAttack * cos((pi / 180) * RollAngle) and the (AngleOfSlip * sin((pi / 180) * RollAngle)) part.
Plz help

  • Log in to leave a comment
  • Profile image
    161k spefyjerbf

    It sounds like you want the behavior of a cosine, but negative values when the angle is negative. In that case, just multiply the cosine by sign(angle).

    4.2 years ago
  • Profile image

    The pi / 180 term is so that when you’re at level flight (for angle of attack), it’s times by 1 in level flight and gets lower when you’re not level, to the point where it’s 0 at 90* and -1 when inverted. @spefyjerbf

    4.2 years ago
  • Profile image
    16.9k YourWife

    AOA inputs behave funny, I've found that when my AOS is at 90 or -90, my AOA input bounces up and down at the intensity of sleddriver's temper when you dont give him upvotes and it really messes up things with what I'm currently developing

    +4 4.2 years ago
  • Profile image
    161k spefyjerbf

    I do not think that you need the pi / 180 term. That would be only necessary if the trig functions required a radian argument. Also, the sine function should have the sum of AoA and pitch angle as it’s argument. I can provide some reference material if you want.

    +1 4.2 years ago