Trying to find air speed of a plane, as opposed to distance traveled

I’m putting together a sort of flight sim, and I’m trying to measure the air speed of my aircraft - The speed at which air flows over the wings - in order to determine the amount of lift generated. I can measure the distance the aircraft moves between frames by comparing transform.position before and after, but this doesn’t take into account things like falling straight down, or potential lateral movement. See this illustration:

The aircraft on the left is frame 1, while the aircraft on the lower right is frame 2. I can get the distance between them easily, but that’s not what I want. I want to isolate just the plane (No pun intended) that frame 1’s direction.forward lies on, and (I guess?) find that component’s contribution to the aircraft’s motion. This would be the slightly transparent hypothetical aircraft in the upper right, which I assume would be a reasonably accurate representation of air speed.

So primarily my question is: How do I do this? And a secondary question would be, is this what I should be doing in the first place?

Prepare thy self, Calculus Incoming!

Provided that there is no wind speed, such that if the plane didn’t exist, there would be no wind, you can determine how much force is being applied to the wings. I don’t know if this is how consumer flight simulations games do this, but this is how to do it with some level of accuracy.

I’m going to massively simplify the equations for Lift and air friction (as provided by NASA’s documentation) due to the fact that finding a coefficient for your object is very complex and there are a lot of other equations and arithmetic involved in determining a specific coefficient for a specific object. We’re going to assume that your coefficient is 1. Its up to you to change this value until the motion of the plane feels more realistic or how ever you want it to feel.

Your goal here is to determine the amount of Torque (Td) created around the wings. This, along with the force caused by jet propulsion, and the force caused by the y axis of the drag (Fdy), will produce your overall Lift.

You can determine that Fdy = Fd * cos(pi)

In the equations above, C = 1, p = air density, A = cross-sectional surface area of the wing bow, and v = velocity. Also, r is equal to the length of the bow of the wing. The bow is the section of the wing that is rotated by a rotor in order to produce all of these desired results. If you haven’t seen this in action, look up some videos on plane lift.

The following equation is the final equation for determining how much torque is present .


In Conclusion:

Use these equations to determine how much rotation occurs. Then use the force of drag in the y-axis to determine how much lift force is caused by air friction. Finally, use the force caused by whatever source of propulsion you have to increase/decrease velocity and indirectly produce this lift effect.

P.S.

Sorry for my pretty bad handwriting, lol.

Found an answer to this, I just needed to read more documentation. Vector3.Dot() lets you find the dot product between two vectors (1 for parallel and in alignment, 0 for perpendicular and -1 for parallel but in opposite alignment), while Vector3.Angle() lets you find the angle between two vectors in degrees, from which you can then work out the component of one vector within the other. Dot() is a bit tricky in some circumstances what with the plane moving and all, so I’m gone the Angle() route.

My code in case anyone is interested:

        Vector3 displacementVector = transform.position - lastLocation;
        float displacement = displacementVector.magnitude / Time.deltaTime;
        airSpeed = ((90.0f - Vector3.Angle(displacementVector, transform.forward)) / 90.0f) * displacement;

I normalize it to 90 because my in-game plane is a human-powered glider, no fancy loop-the-loops or anything like that.