Check if a point is inside a rotated 2D NACA 0012 airfoil

264 Views Asked by At

I've already checked the rotated rectangle problem but this is (I think!) a little more complicated.

I have a CFD calculation of a 2D NACA 0012 airfoil and I need to test if a point is inside the airfoil or not. This is the equation for the airfoil: $$ y_t = 5tc \left[ 0.2969 \sqrt{\frac{x}{c}} - 0.1260 \, \frac{x}{c} - 0.3516 \left(\frac{x}{c}\right)^2 + 0.2843 \left(\frac{x}{c}\right)^3 - 0.1015 \left(\frac{x}{c}\right)^4 \right] $$

The notation I'm using is the following:

  • $c$ -> chord (airfoil length) ;
  • $(x_C,y_C)$ -> coordinates of the $c/2$ (half chord) point of the airfoil ;
  • $(x_0,y_0)$ -> coordinates of the point I need to know if it's inside or outside the airfoil ;

For an un-rotated airfoil this is easily done:

  1. Check if $(x_C - c/2) < x_0 < (x_C + c/2)$ ;
  2. If 1. is true, compute $y_t$ as in the equation above, with $x = x_0 - (x_C - c/2)$;
  3. Check if $(y_C - y_t) < y_0 < (y_C + y_t)$;
  4. If 1. and 3. are both true, the point is inside the airfoil ;

How about for an airfoil with a given angle of attack (like the one bellow)?

Rotated NACA 0012 airfoil

I've been trying to find an easy way to do this, without much success so far (I was never very good with angles and rotations). My original idea was to rotate my reference frame to be aligned with the rotated airfoil and evaluate 1. trough 4. in that rotated frame.

How can I do that? Is there a better way?

Thank you for your time.